{"action":"created","issue":{"url":"https://api.github.com/repos/phetsims/balloons-and-static-electricity/issues/202","repository_url":"https://api.github.com/repos/phetsims/balloons-and-static-electricity","labels_url":"https://api.github.com/repos/phetsims/balloons-and-static-electricity/issues/202/labels{/name}","comments_url":"https://api.github.com/repos/phetsims/balloons-and-static-electricity/issues/202/comments","events_url":"https://api.github.com/repos/phetsims/balloons-and-static-electricity/issues/202/events","html_url":"https://github.com/phetsims/balloons-and-static-electricity/issues/202","id":188954054,"node_id":"MDU6SXNzdWUxODg5NTQwNTQ=","number":202,"title":"Factor out pattern for creating bounds","user":{"login":"samreid","id":679486,"node_id":"MDQ6VXNlcjY3OTQ4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/679486?v=4","gravatar_id":"","url":"https://api.github.com/users/samreid","html_url":"https://github.com/samreid","followers_url":"https://api.github.com/users/samreid/followers","following_url":"https://api.github.com/users/samreid/following{/other_user}","gists_url":"https://api.github.com/users/samreid/gists{/gist_id}","starred_url":"https://api.github.com/users/samreid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samreid/subscriptions","organizations_url":"https://api.github.com/users/samreid/orgs","repos_url":"https://api.github.com/users/samreid/repos","events_url":"https://api.github.com/users/samreid/events{/privacy}","received_events_url":"https://api.github.com/users/samreid/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"jessegreenberg","id":6396244,"node_id":"MDQ6VXNlcjYzOTYyNDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6396244?v=4","gravatar_id":"","url":"https://api.github.com/users/jessegreenberg","html_url":"https://github.com/jessegreenberg","followers_url":"https://api.github.com/users/jessegreenberg/followers","following_url":"https://api.github.com/users/jessegreenberg/following{/other_user}","gists_url":"https://api.github.com/users/jessegreenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jessegreenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessegreenberg/subscriptions","organizations_url":"https://api.github.com/users/jessegreenberg/orgs","repos_url":"https://api.github.com/users/jessegreenberg/repos","events_url":"https://api.github.com/users/jessegreenberg/events{/privacy}","received_events_url":"https://api.github.com/users/jessegreenberg/received_events","type":"User","site_admin":false},"assignees":[{"login":"jessegreenberg","id":6396244,"node_id":"MDQ6VXNlcjYzOTYyNDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6396244?v=4","gravatar_id":"","url":"https://api.github.com/users/jessegreenberg","html_url":"https://github.com/jessegreenberg","followers_url":"https://api.github.com/users/jessegreenberg/followers","following_url":"https://api.github.com/users/jessegreenberg/following{/other_user}","gists_url":"https://api.github.com/users/jessegreenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jessegreenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessegreenberg/subscriptions","organizations_url":"https://api.github.com/users/jessegreenberg/orgs","repos_url":"https://api.github.com/users/jessegreenberg/repos","events_url":"https://api.github.com/users/jessegreenberg/events{/privacy}","received_events_url":"https://api.github.com/users/jessegreenberg/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-11-13T05:56:33Z","updated_at":"2018-06-13T20:59:36Z","closed_at":"2018-06-13T20:59:36Z","author_association":"MEMBER","body":"During #201 I saw this code:\r\n\r\n```js\r\n    // @public (read-only) - left edge of play area\r\n    this.leftColumn = new Bounds2( x, y, x + leftEdgeWidth, height );\r\n    x += leftEdgeWidth;\r\n\r\n    // @public (read-only) - left arm down sweater\r\n    this.leftArmColumn = new Bounds2( x, y, x + sweaterSectionWidth, height );\r\n    x += sweaterSectionWidth;\r\n\r\n    // @public (read-only) - left side of sweater body arm down sweater\r\n    this.leftBodyColumn = new Bounds2( x, y, x + sweaterSectionWidth, height );\r\n    x += sweaterSectionWidth;\r\n\r\n    // @public (read-only) - right side of sweater body arm down sweater\r\n    this.rightBodyColumn = new Bounds2( x, y, x + sweaterSectionWidth, height );\r\n    x += sweaterSectionWidth;\r\n\r\n    // @public (read-only) - right arm down sweater\r\n    this.rightArmColumn = new Bounds2( x, y, x + sweaterSectionWidth, height );\r\n    x += sweaterSectionWidth;\r\n\r\n    // @public (read-only) - left side of play area (but to the right of sweater)\r\n    this.playAreaLeftColumn = new Bounds2( x, y, x + leftSideWidth, height );\r\n    x += leftSideWidth;\r\n\r\n    // @public (read-only) - center of the play area\r\n    this.playAreaCenterColumn = new Bounds2( x, y, x + centerWidth, height );\r\n    x += centerWidth;\r\n\r\n    // @public (read-only) - right side of play area (but to the left of the wall)\r\n    this.playAreaRightColumn = new Bounds2( x, y, x + rightSideWidth, height );\r\n    x += rightSideWidth;\r\n\r\n    // @public (read-only) - right edge of play area\r\n    this.rightColumn = new Bounds2( x, y, x + rightEdgeWidth, height );\r\n```\r\n\r\nIt seemed somewhat fragile, because changing a width on one line requires synchronizing changing the x value on the next line.  I wonder if it should be written like so (with the appropriate definition of createBounds):\r\n\r\n```js\r\n    // @public (read-only) - left edge of play area\r\n    this.leftColumn = createBounds( leftEdgeWidth );\r\n\r\n    // @public (read-only) - left arm down sweater\r\n    this.leftArmColumn = createBounds( sweaterSectionWidth );\r\n\r\n    // @public (read-only) - left side of sweater body arm down sweater\r\n    this.leftBodyColumn = createBounds( sweaterSectionWidth );\r\n\r\n    // @public (read-only) - right side of sweater body arm down sweater\r\n    this.rightBodyColumn = createBounds( sweaterSectionWidth );\r\n\r\n    // @public (read-only) - right arm down sweater\r\n    this.rightArmColumn = createBounds( sweaterSectionWidth );\r\n\r\n    // @public (read-only) - left side of play area (but to the right of sweater)\r\n    this.playAreaLeftColumn = createBounds( leftSideWidth );\r\n\r\n    // @public (read-only) - center of the play area\r\n    this.playAreaCenterColumn = createBounds( centerWidth );\r\n\r\n    // @public (read-only) - right side of play area (but to the left of the wall)\r\n    this.playAreaRightColumn = createBounds( rightSideWidth );\r\n\r\n    // @public (read-only) - right edge of play area\r\n    this.rightColumn = createBounds( rightEdgeWidth );\r\n```"},"comment":{"url":"https://api.github.com/repos/phetsims/balloons-and-static-electricity/issues/comments/397084888","html_url":"https://github.com/phetsims/balloons-and-static-electricity/issues/202#issuecomment-397084888","issue_url":"https://api.github.com/repos/phetsims/balloons-and-static-electricity/issues/202","id":397084888,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzA4NDg4OA==","user":{"login":"jessegreenberg","id":6396244,"node_id":"MDQ6VXNlcjYzOTYyNDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6396244?v=4","gravatar_id":"","url":"https://api.github.com/users/jessegreenberg","html_url":"https://github.com/jessegreenberg","followers_url":"https://api.github.com/users/jessegreenberg/followers","following_url":"https://api.github.com/users/jessegreenberg/following{/other_user}","gists_url":"https://api.github.com/users/jessegreenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jessegreenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessegreenberg/subscriptions","organizations_url":"https://api.github.com/users/jessegreenberg/orgs","repos_url":"https://api.github.com/users/jessegreenberg/repos","events_url":"https://api.github.com/users/jessegreenberg/events{/privacy}","received_events_url":"https://api.github.com/users/jessegreenberg/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T20:59:36Z","updated_at":"2018-06-13T20:59:36Z","author_association":"CONTRIBUTOR","body":"This is a nice suggestion @samreid, thanks. The way the Play Area is mapped out now is a bit different than it was when this issue was first created, and uses Ranges instead of Bounds, but it is using the general strategy recommended in this issue ticket. Closing this issue."}}
{"actor":{"display_login":"jessegreenberg"}}