{"action":"created","issue":{"url":"https://api.github.com/repos/photonstorm/phaser/issues/1822","labels_url":"https://api.github.com/repos/photonstorm/phaser/issues/1822/labels{/name}","comments_url":"https://api.github.com/repos/photonstorm/phaser/issues/1822/comments","events_url":"https://api.github.com/repos/photonstorm/phaser/issues/1822/events","html_url":"https://github.com/photonstorm/phaser/issues/1822","id":82040942,"number":1822,"title":"Phaser.Graphics.drawRoundedRect: radius restrictions","user":{"login":"mpostma","id":2144601,"avatar_url":"https://avatars.githubusercontent.com/u/2144601?v=3","gravatar_id":"","url":"https://api.github.com/users/mpostma","html_url":"https://github.com/mpostma","followers_url":"https://api.github.com/users/mpostma/followers","following_url":"https://api.github.com/users/mpostma/following{/other_user}","gists_url":"https://api.github.com/users/mpostma/gists{/gist_id}","starred_url":"https://api.github.com/users/mpostma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpostma/subscriptions","organizations_url":"https://api.github.com/users/mpostma/orgs","repos_url":"https://api.github.com/users/mpostma/repos","events_url":"https://api.github.com/users/mpostma/events{/privacy}","received_events_url":"https://api.github.com/users/mpostma/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/photonstorm/phaser/labels/bug%20(pixi)","name":"bug (pixi)","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-28T17:28:17Z","updated_at":"2015-06-16T16:17:49Z","closed_at":"2015-06-16T16:17:49Z","body":"I am running into a strange issue with the drawRoundedRect function (http://phaser.io/docs/PIXI.Graphics.html/Phaser.Graphics.html#drawRoundedRect).\r\n\r\nThe function works fine with a radius from 0 to 9, but as soon as you give it a radius of 10 or more it crashes if the game is running in WebGL (Canvas is working fine with any radius). Some sample code to reproduce:\r\n\r\n```\r\nvar button = this.game.add.graphics(100, 100);\r\nbutton.beginFill(0xAAAAAA, 1);\r\nbutton.drawRoundedRect(0, 0, 50, 50, 10);\r\n```\r\n\r\nThe problem is that `var triangles = PIXI.PolyK.Triangulate(recPoints);` inside of PIXI.WebGLGraphics.buildRoundedRectangle returns null, so everything fails as soon as the next loop tries to access `triangles.length`. The only hint PIXI is giving is `window.console.log(\"PIXI Warning: shape too complex to fill\");`, which seems like an odd error for such a simple shape...\r\n\r\nI am unclear exactly how the information is passed/translated from Phaser to PIXI, so I am not sure where the issue is (Phaser or PIXI). But, even if it's a PIXI issue, it might be worth mentioning this radius limitation in the Phaser docs (until PIXI fixes it)."},"comment":{"url":"https://api.github.com/repos/photonstorm/phaser/issues/comments/112483716","html_url":"https://github.com/photonstorm/phaser/issues/1822#issuecomment-112483716","issue_url":"https://api.github.com/repos/photonstorm/phaser/issues/1822","id":112483716,"user":{"login":"photonstorm","id":164476,"avatar_url":"https://avatars.githubusercontent.com/u/164476?v=3","gravatar_id":"","url":"https://api.github.com/users/photonstorm","html_url":"https://github.com/photonstorm","followers_url":"https://api.github.com/users/photonstorm/followers","following_url":"https://api.github.com/users/photonstorm/following{/other_user}","gists_url":"https://api.github.com/users/photonstorm/gists{/gist_id}","starred_url":"https://api.github.com/users/photonstorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/photonstorm/subscriptions","organizations_url":"https://api.github.com/users/photonstorm/orgs","repos_url":"https://api.github.com/users/photonstorm/repos","events_url":"https://api.github.com/users/photonstorm/events{/privacy}","received_events_url":"https://api.github.com/users/photonstorm/received_events","type":"User","site_admin":false},"created_at":"2015-06-16T16:17:49Z","updated_at":"2015-06-16T16:17:49Z","body":"Thought so, I've added it to the docs and will close this one off."}}