{"action":"created","issue":{"url":"https://api.github.com/repos/melonjs/melonJS/issues/692","labels_url":"https://api.github.com/repos/melonjs/melonJS/issues/692/labels{/name}","comments_url":"https://api.github.com/repos/melonjs/melonJS/issues/692/comments","events_url":"https://api.github.com/repos/melonjs/melonJS/issues/692/events","html_url":"https://github.com/melonjs/melonJS/issues/692","id":84856238,"number":692,"title":"me.Container.draw should clip children to its own bounds","user":{"login":"parasyte","id":456942,"avatar_url":"https://avatars.githubusercontent.com/u/456942?v=3","gravatar_id":"","url":"https://api.github.com/users/parasyte","html_url":"https://github.com/parasyte","followers_url":"https://api.github.com/users/parasyte/followers","following_url":"https://api.github.com/users/parasyte/following{/other_user}","gists_url":"https://api.github.com/users/parasyte/gists{/gist_id}","starred_url":"https://api.github.com/users/parasyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parasyte/subscriptions","organizations_url":"https://api.github.com/users/parasyte/orgs","repos_url":"https://api.github.com/users/parasyte/repos","events_url":"https://api.github.com/users/parasyte/events{/privacy}","received_events_url":"https://api.github.com/users/parasyte/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/melonjs/melonJS/milestones/20","html_url":"https://github.com/melonjs/melonJS/milestones/2.2.0","labels_url":"https://api.github.com/repos/melonjs/melonJS/milestones/20/labels","id":928007,"number":20,"title":"2.2.0","description":"","creator":{"login":"obiot","id":4033090,"avatar_url":"https://avatars.githubusercontent.com/u/4033090?v=3","gravatar_id":"","url":"https://api.github.com/users/obiot","html_url":"https://github.com/obiot","followers_url":"https://api.github.com/users/obiot/followers","following_url":"https://api.github.com/users/obiot/following{/other_user}","gists_url":"https://api.github.com/users/obiot/gists{/gist_id}","starred_url":"https://api.github.com/users/obiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obiot/subscriptions","organizations_url":"https://api.github.com/users/obiot/orgs","repos_url":"https://api.github.com/users/obiot/repos","events_url":"https://api.github.com/users/obiot/events{/privacy}","received_events_url":"https://api.github.com/users/obiot/received_events","type":"User","site_admin":false},"open_issues":37,"closed_issues":3,"state":"open","created_at":"2015-01-09T01:45:25Z","updated_at":"2015-06-04T01:47:15Z","due_on":"2015-07-19T16:00:00Z","closed_at":null},"comments":1,"created_at":"2015-06-04T01:44:42Z","updated_at":"2015-06-10T02:52:30Z","closed_at":null,"body":"From https://github.com/melonjs/melonJS/issues/649#issuecomment-75360960\r\n\r\nCanvas clipping regions: https://developer.mozilla.org/samples/canvas-tutorial/6_2_canvas_clipping.html\r\n\r\n```javascript\r\nrenderer.save();\r\nrenderer.clipRect(this.pos.x, this.pos.y, this.width, this.height);\r\n// ... loop through children here and call their draw method\r\nrenderer.restore();\r\n```\r\n\r\nFor WebGL, use the stencil buffer."},"comment":{"url":"https://api.github.com/repos/melonjs/melonJS/issues/comments/110568215","html_url":"https://github.com/melonjs/melonJS/issues/692#issuecomment-110568215","issue_url":"https://api.github.com/repos/melonjs/melonJS/issues/692","id":110568215,"user":{"login":"obiot","id":4033090,"avatar_url":"https://avatars.githubusercontent.com/u/4033090?v=3","gravatar_id":"","url":"https://api.github.com/users/obiot","html_url":"https://github.com/obiot","followers_url":"https://api.github.com/users/obiot/followers","following_url":"https://api.github.com/users/obiot/following{/other_user}","gists_url":"https://api.github.com/users/obiot/gists{/gist_id}","starred_url":"https://api.github.com/users/obiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obiot/subscriptions","organizations_url":"https://api.github.com/users/obiot/orgs","repos_url":"https://api.github.com/users/obiot/repos","events_url":"https://api.github.com/users/obiot/events{/privacy}","received_events_url":"https://api.github.com/users/obiot/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T02:52:30Z","updated_at":"2015-06-10T02:52:30Z","body":"wait, two different questions on this one :\r\n- if the container should clip children to its own bounds, should the children position also capped to the maximum container limits ?\r\n- at the contrary, is it not more logical and practical to dynamically resize the container based on all children position/size ?"}}