{"action":"created","issue":{"url":"https://api.github.com/repos/craftyjs/Crafty/issues/859","labels_url":"https://api.github.com/repos/craftyjs/Crafty/issues/859/labels{/name}","comments_url":"https://api.github.com/repos/craftyjs/Crafty/issues/859/comments","events_url":"https://api.github.com/repos/craftyjs/Crafty/issues/859/events","html_url":"https://github.com/craftyjs/Crafty/pull/859","id":55982260,"number":859,"title":"Organize graphics","user":{"login":"starwed","id":34907,"avatar_url":"https://avatars.githubusercontent.com/u/34907?v=3","gravatar_id":"","url":"https://api.github.com/users/starwed","html_url":"https://github.com/starwed","followers_url":"https://api.github.com/users/starwed/followers","following_url":"https://api.github.com/users/starwed/following{/other_user}","gists_url":"https://api.github.com/users/starwed/gists{/gist_id}","starred_url":"https://api.github.com/users/starwed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starwed/subscriptions","organizations_url":"https://api.github.com/users/starwed/orgs","repos_url":"https://api.github.com/users/starwed/repos","events_url":"https://api.github.com/users/starwed/events{/privacy}","received_events_url":"https://api.github.com/users/starwed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-30T01:17:09Z","updated_at":"2015-01-30T01:23:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/craftyjs/Crafty/pulls/859","html_url":"https://github.com/craftyjs/Crafty/pull/859","diff_url":"https://github.com/craftyjs/Crafty/pull/859.diff","patch_url":"https://github.com/craftyjs/Crafty/pull/859.patch"},"body":"This is a pretty drastic reorganization of the rendering/viewport/stage code.  The different pieces for handling DOM and Canvas rendering were split up over several files and mixed with each other in a confusing way.\r\n\r\nThis creates two new objects which have more clearcut responsibilities, and are designed to be clearly parallel with themselves and the webgl rendering code.\r\n - `Crafty.canvasLayer` for init and rendering on the canvas element\r\n - `Crafty.domLayer` for init and rendering on the div element we use to place DOM entities\r\n\r\nSeveral objects are shuffled around or renamed: `Crafty.DOM` becomes `Crafty.domHelper`, `Crafty.rectManager` absorbs `Crafty._rectPool` and gets its own file, and `Crafty.DrawManager` is just gone!\r\n\r\nThere were very few actual changes to the code logic; it was mostly just renaming things and shifting methods from one object to another.  I did make it so the DOM layer is only created when you actually have DOM entities, and slightly alter how Crafty determines the window size, since that was weirdly tangled up in that init code.\r\n\r\nThe main impulse for this reorganization wasn't just to clean things up, but to prepare the way for a more abstract approach to creating layers -- we want to be able to create foreground/background/UI layers, for instance, and dictate the render type of each.  This is a good first step towards that."},"comment":{"url":"https://api.github.com/repos/craftyjs/Crafty/issues/comments/72138126","html_url":"https://github.com/craftyjs/Crafty/pull/859#issuecomment-72138126","issue_url":"https://api.github.com/repos/craftyjs/Crafty/issues/859","id":72138126,"user":{"login":"starwed","id":34907,"avatar_url":"https://avatars.githubusercontent.com/u/34907?v=3","gravatar_id":"","url":"https://api.github.com/users/starwed","html_url":"https://github.com/starwed","followers_url":"https://api.github.com/users/starwed/followers","following_url":"https://api.github.com/users/starwed/following{/other_user}","gists_url":"https://api.github.com/users/starwed/gists{/gist_id}","starred_url":"https://api.github.com/users/starwed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starwed/subscriptions","organizations_url":"https://api.github.com/users/starwed/orgs","repos_url":"https://api.github.com/users/starwed/repos","events_url":"https://api.github.com/users/starwed/events{/privacy}","received_events_url":"https://api.github.com/users/starwed/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T01:23:52Z","updated_at":"2015-01-30T01:23:52Z","body":"Hmm, while this passes tests, there's some issue coming up when I try the built file in more complicated examples.  I'll try to figure out what's up and push a fix."}}