{"action":"closed","number":1204,"pull_request":{"url":"https://api.github.com/repos/shoes/shoes4/pulls/1204","id":53500860,"html_url":"https://github.com/shoes/shoes4/pull/1204","diff_url":"https://github.com/shoes/shoes4/pull/1204.diff","patch_url":"https://github.com/shoes/shoes4/pull/1204.patch","issue_url":"https://api.github.com/repos/shoes/shoes4/issues/1204","number":1204,"state":"closed","locked":false,"title":"Correctly using parents margin for background","user":{"login":"PragTob","id":606517,"avatar_url":"https://avatars.githubusercontent.com/u/606517?v=3","gravatar_id":"","url":"https://api.github.com/users/PragTob","html_url":"https://github.com/PragTob","followers_url":"https://api.github.com/users/PragTob/followers","following_url":"https://api.github.com/users/PragTob/following{/other_user}","gists_url":"https://api.github.com/users/PragTob/gists{/gist_id}","starred_url":"https://api.github.com/users/PragTob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PragTob/subscriptions","organizations_url":"https://api.github.com/users/PragTob/orgs","repos_url":"https://api.github.com/users/PragTob/repos","events_url":"https://api.github.com/users/PragTob/events{/privacy}","received_events_url":"https://api.github.com/users/PragTob/received_events","type":"User","site_admin":false},"body":"This rethinks ParentDimension a bunch, from 3 main observations:\r\n\r\n* we should not position backgrounds, it works when they are\r\n  the first element in a slot but not after that\r\n* backgrounds need to respect the margins of parents, which means\r\n  their absolute_starts should be the parents element_starts\r\n* beyond that, there doesn't seem to be much need to get\r\n  parent position values, as they all somehow end up\r\n  influencing absolute_top/left (I hope, this might come back\r\n  later)\r\n\r\nThat also removes a lot of ambiguity and difficult code.\r\nBetter code through increased domain understanding :+1:\r\n\r\n* fixes #1193 \r\n\r\nsucceeds #1203 \r\n\r\n\r\nA look at a couple of examples between shoes 4 and shoes 3.2:\r\n\r\n```ruby\r\nShoes.app do\r\n  stack margin: 20, height: 100 do\r\n    background green\r\n  end\r\n\r\n  stack margin: 40, height: 100 do\r\n    background blue\r\n  end\r\nend\r\n```\r\n\r\n![selection_031](https://cloud.githubusercontent.com/assets/606517/11767355/26f7f59e-a1ab-11e5-806b-1c41dac76cc6.png)\r\n\r\n\r\n```ruby\r\nShoes.app do\r\n  banner 'What up'\r\n  background red\r\nend\r\n```\r\n\r\n(see #599)\r\n\r\n![selection_032](https://cloud.githubusercontent.com/assets/606517/11767359/527eb19e-a1ab-11e5-8688-332f7feb0100.png)\r\n\r\n\r\n```ruby\r\nShoes.app do\r\n  stack height: 150, bottom: 50 do\r\n    background red\r\n  end\r\nend\r\n```\r\n\r\n(some more advanced positioning)\r\n\r\n![selection_033](https://cloud.githubusercontent.com/assets/606517/11767368/b1d24f7a-a1ab-11e5-82ed-5ab30cab0cef.png)\r\n\r\n\r\n```ruby\r\nShoes.app do\r\n  stack margin: 20, height: 200 do\r\n    background blue\r\n    background green, margin: 20\r\n  end\r\nend\r\n```\r\n\r\n(double margin)\r\n\r\n![selection_034](https://cloud.githubusercontent.com/assets/606517/11767383/1fe1aca4-a1ac-11e5-89af-4680498e475c.png)\r\n\r\nlast but not least `good-vjot.rb` which still has some issues but those are of another nature (or at least I believe so ;))\r\n\r\n\r\n![good-vjot](https://dl.dropboxusercontent.com/u/16854702/Selection_035.png)\r\n\r\n\r\n\r\n","created_at":"2015-12-13T14:20:39Z","updated_at":"2015-12-14T06:54:48Z","closed_at":"2015-12-14T06:54:47Z","merged_at":"2015-12-14T06:54:47Z","merge_commit_sha":"aa4bea816e2f59b930c7ece2452f4f2bb6ffc8f8","assignee":null,"milestone":{"url":"https://api.github.com/repos/shoes/shoes4/milestones/8","html_url":"https://github.com/shoes/shoes4/milestones/4.0.0.pre5","labels_url":"https://api.github.com/repos/shoes/shoes4/milestones/8/labels","id":1094491,"number":8,"title":"4.0.0.pre5","description":"","creator":{"login":"jasonrclark","id":130504,"avatar_url":"https://avatars.githubusercontent.com/u/130504?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonrclark","html_url":"https://github.com/jasonrclark","followers_url":"https://api.github.com/users/jasonrclark/followers","following_url":"https://api.github.com/users/jasonrclark/following{/other_user}","gists_url":"https://api.github.com/users/jasonrclark/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonrclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonrclark/subscriptions","organizations_url":"https://api.github.com/users/jasonrclark/orgs","repos_url":"https://api.github.com/users/jasonrclark/repos","events_url":"https://api.github.com/users/jasonrclark/events{/privacy}","received_events_url":"https://api.github.com/users/jasonrclark/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":36,"state":"open","created_at":"2015-05-04T05:00:18Z","updated_at":"2015-12-14T06:54:47Z","due_on":"2015-12-13T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/shoes/shoes4/pulls/1204/commits","review_comments_url":"https://api.github.com/repos/shoes/shoes4/pulls/1204/comments","review_comment_url":"https://api.github.com/repos/shoes/shoes4/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shoes/shoes4/issues/1204/comments","statuses_url":"https://api.github.com/repos/shoes/shoes4/statuses/da9dbe8f214bc8bca715b20c60a44fdf4c8e4258","head":{"label":"shoes:margins-on-background-2-1193","ref":"margins-on-background-2-1193","sha":"da9dbe8f214bc8bca715b20c60a44fdf4c8e4258","user":{"login":"shoes","id":119935,"avatar_url":"https://avatars.githubusercontent.com/u/119935?v=3","gravatar_id":"","url":"https://api.github.com/users/shoes","html_url":"https://github.com/shoes","followers_url":"https://api.github.com/users/shoes/followers","following_url":"https://api.github.com/users/shoes/following{/other_user}","gists_url":"https://api.github.com/users/shoes/gists{/gist_id}","starred_url":"https://api.github.com/users/shoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoes/subscriptions","organizations_url":"https://api.github.com/users/shoes/orgs","repos_url":"https://api.github.com/users/shoes/repos","events_url":"https://api.github.com/users/shoes/events{/privacy}","received_events_url":"https://api.github.com/users/shoes/received_events","type":"Organization","site_admin":false},"repo":{"id":4434126,"name":"shoes4","full_name":"shoes/shoes4","owner":{"login":"shoes","id":119935,"avatar_url":"https://avatars.githubusercontent.com/u/119935?v=3","gravatar_id":"","url":"https://api.github.com/users/shoes","html_url":"https://github.com/shoes","followers_url":"https://api.github.com/users/shoes/followers","following_url":"https://api.github.com/users/shoes/following{/other_user}","gists_url":"https://api.github.com/users/shoes/gists{/gist_id}","starred_url":"https://api.github.com/users/shoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoes/subscriptions","organizations_url":"https://api.github.com/users/shoes/orgs","repos_url":"https://api.github.com/users/shoes/repos","events_url":"https://api.github.com/users/shoes/events{/privacy}","received_events_url":"https://api.github.com/users/shoes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shoes/shoes4","description":"Shoes 4 : the next version of Shoes","fork":false,"url":"https://api.github.com/repos/shoes/shoes4","forks_url":"https://api.github.com/repos/shoes/shoes4/forks","keys_url":"https://api.github.com/repos/shoes/shoes4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shoes/shoes4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shoes/shoes4/teams","hooks_url":"https://api.github.com/repos/shoes/shoes4/hooks","issue_events_url":"https://api.github.com/repos/shoes/shoes4/issues/events{/number}","events_url":"https://api.github.com/repos/shoes/shoes4/events","assignees_url":"https://api.github.com/repos/shoes/shoes4/assignees{/user}","branches_url":"https://api.github.com/repos/shoes/shoes4/branches{/branch}","tags_url":"https://api.github.com/repos/shoes/shoes4/tags","blobs_url":"https://api.github.com/repos/shoes/shoes4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shoes/shoes4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shoes/shoes4/git/refs{/sha}","trees_url":"https://api.github.com/repos/shoes/shoes4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shoes/shoes4/statuses/{sha}","languages_url":"https://api.github.com/repos/shoes/shoes4/languages","stargazers_url":"https://api.github.com/repos/shoes/shoes4/stargazers","contributors_url":"https://api.github.com/repos/shoes/shoes4/contributors","subscribers_url":"https://api.github.com/repos/shoes/shoes4/subscribers","subscription_url":"https://api.github.com/repos/shoes/shoes4/subscription","commits_url":"https://api.github.com/repos/shoes/shoes4/commits{/sha}","git_commits_url":"https://api.github.com/repos/shoes/shoes4/git/commits{/sha}","comments_url":"https://api.github.com/repos/shoes/shoes4/comments{/number}","issue_comment_url":"https://api.github.com/repos/shoes/shoes4/issues/comments{/number}","contents_url":"https://api.github.com/repos/shoes/shoes4/contents/{+path}","compare_url":"https://api.github.com/repos/shoes/shoes4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shoes/shoes4/merges","archive_url":"https://api.github.com/repos/shoes/shoes4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shoes/shoes4/downloads","issues_url":"https://api.github.com/repos/shoes/shoes4/issues{/number}","pulls_url":"https://api.github.com/repos/shoes/shoes4/pulls{/number}","milestones_url":"https://api.github.com/repos/shoes/shoes4/milestones{/number}","notifications_url":"https://api.github.com/repos/shoes/shoes4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shoes/shoes4/labels{/name}","releases_url":"https://api.github.com/repos/shoes/shoes4/releases{/id}","created_at":"2012-05-24T14:57:59Z","updated_at":"2015-12-11T12:49:35Z","pushed_at":"2015-12-14T06:54:48Z","git_url":"git://github.com/shoes/shoes4.git","ssh_url":"git@github.com:shoes/shoes4.git","clone_url":"https://github.com/shoes/shoes4.git","svn_url":"https://github.com/shoes/shoes4","homepage":"","size":55373,"stargazers_count":905,"watchers_count":905,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":164,"mirror_url":null,"open_issues_count":134,"forks":164,"open_issues":134,"watchers":905,"default_branch":"master"}},"base":{"label":"shoes:master","ref":"master","sha":"9c3d141a34c1647bcd64de884e93d0004d9b0041","user":{"login":"shoes","id":119935,"avatar_url":"https://avatars.githubusercontent.com/u/119935?v=3","gravatar_id":"","url":"https://api.github.com/users/shoes","html_url":"https://github.com/shoes","followers_url":"https://api.github.com/users/shoes/followers","following_url":"https://api.github.com/users/shoes/following{/other_user}","gists_url":"https://api.github.com/users/shoes/gists{/gist_id}","starred_url":"https://api.github.com/users/shoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoes/subscriptions","organizations_url":"https://api.github.com/users/shoes/orgs","repos_url":"https://api.github.com/users/shoes/repos","events_url":"https://api.github.com/users/shoes/events{/privacy}","received_events_url":"https://api.github.com/users/shoes/received_events","type":"Organization","site_admin":false},"repo":{"id":4434126,"name":"shoes4","full_name":"shoes/shoes4","owner":{"login":"shoes","id":119935,"avatar_url":"https://avatars.githubusercontent.com/u/119935?v=3","gravatar_id":"","url":"https://api.github.com/users/shoes","html_url":"https://github.com/shoes","followers_url":"https://api.github.com/users/shoes/followers","following_url":"https://api.github.com/users/shoes/following{/other_user}","gists_url":"https://api.github.com/users/shoes/gists{/gist_id}","starred_url":"https://api.github.com/users/shoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoes/subscriptions","organizations_url":"https://api.github.com/users/shoes/orgs","repos_url":"https://api.github.com/users/shoes/repos","events_url":"https://api.github.com/users/shoes/events{/privacy}","received_events_url":"https://api.github.com/users/shoes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shoes/shoes4","description":"Shoes 4 : the next version of Shoes","fork":false,"url":"https://api.github.com/repos/shoes/shoes4","forks_url":"https://api.github.com/repos/shoes/shoes4/forks","keys_url":"https://api.github.com/repos/shoes/shoes4/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shoes/shoes4/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shoes/shoes4/teams","hooks_url":"https://api.github.com/repos/shoes/shoes4/hooks","issue_events_url":"https://api.github.com/repos/shoes/shoes4/issues/events{/number}","events_url":"https://api.github.com/repos/shoes/shoes4/events","assignees_url":"https://api.github.com/repos/shoes/shoes4/assignees{/user}","branches_url":"https://api.github.com/repos/shoes/shoes4/branches{/branch}","tags_url":"https://api.github.com/repos/shoes/shoes4/tags","blobs_url":"https://api.github.com/repos/shoes/shoes4/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shoes/shoes4/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shoes/shoes4/git/refs{/sha}","trees_url":"https://api.github.com/repos/shoes/shoes4/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shoes/shoes4/statuses/{sha}","languages_url":"https://api.github.com/repos/shoes/shoes4/languages","stargazers_url":"https://api.github.com/repos/shoes/shoes4/stargazers","contributors_url":"https://api.github.com/repos/shoes/shoes4/contributors","subscribers_url":"https://api.github.com/repos/shoes/shoes4/subscribers","subscription_url":"https://api.github.com/repos/shoes/shoes4/subscription","commits_url":"https://api.github.com/repos/shoes/shoes4/commits{/sha}","git_commits_url":"https://api.github.com/repos/shoes/shoes4/git/commits{/sha}","comments_url":"https://api.github.com/repos/shoes/shoes4/comments{/number}","issue_comment_url":"https://api.github.com/repos/shoes/shoes4/issues/comments{/number}","contents_url":"https://api.github.com/repos/shoes/shoes4/contents/{+path}","compare_url":"https://api.github.com/repos/shoes/shoes4/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shoes/shoes4/merges","archive_url":"https://api.github.com/repos/shoes/shoes4/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shoes/shoes4/downloads","issues_url":"https://api.github.com/repos/shoes/shoes4/issues{/number}","pulls_url":"https://api.github.com/repos/shoes/shoes4/pulls{/number}","milestones_url":"https://api.github.com/repos/shoes/shoes4/milestones{/number}","notifications_url":"https://api.github.com/repos/shoes/shoes4/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shoes/shoes4/labels{/name}","releases_url":"https://api.github.com/repos/shoes/shoes4/releases{/id}","created_at":"2012-05-24T14:57:59Z","updated_at":"2015-12-11T12:49:35Z","pushed_at":"2015-12-14T06:54:48Z","git_url":"git://github.com/shoes/shoes4.git","ssh_url":"git@github.com:shoes/shoes4.git","clone_url":"https://github.com/shoes/shoes4.git","svn_url":"https://github.com/shoes/shoes4","homepage":"","size":55373,"stargazers_count":905,"watchers_count":905,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":164,"mirror_url":null,"open_issues_count":134,"forks":164,"open_issues":134,"watchers":905,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shoes/shoes4/pulls/1204"},"html":{"href":"https://github.com/shoes/shoes4/pull/1204"},"issue":{"href":"https://api.github.com/repos/shoes/shoes4/issues/1204"},"comments":{"href":"https://api.github.com/repos/shoes/shoes4/issues/1204/comments"},"review_comments":{"href":"https://api.github.com/repos/shoes/shoes4/pulls/1204/comments"},"review_comment":{"href":"https://api.github.com/repos/shoes/shoes4/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shoes/shoes4/pulls/1204/commits"},"statuses":{"href":"https://api.github.com/repos/shoes/shoes4/statuses/da9dbe8f214bc8bca715b20c60a44fdf4c8e4258"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"jasonrclark","id":130504,"avatar_url":"https://avatars.githubusercontent.com/u/130504?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonrclark","html_url":"https://github.com/jasonrclark","followers_url":"https://api.github.com/users/jasonrclark/followers","following_url":"https://api.github.com/users/jasonrclark/following{/other_user}","gists_url":"https://api.github.com/users/jasonrclark/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonrclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonrclark/subscriptions","organizations_url":"https://api.github.com/users/jasonrclark/orgs","repos_url":"https://api.github.com/users/jasonrclark/repos","events_url":"https://api.github.com/users/jasonrclark/events{/privacy}","received_events_url":"https://api.github.com/users/jasonrclark/received_events","type":"User","site_admin":false},"comments":1,"review_comments":1,"commits":1,"additions":41,"deletions":42,"changed_files":3}}