{"action":"closed","issue":{"url":"https://api.github.com/repos/photonstorm/phaser/issues/3884","repository_url":"https://api.github.com/repos/photonstorm/phaser","labels_url":"https://api.github.com/repos/photonstorm/phaser/issues/3884/labels{/name}","comments_url":"https://api.github.com/repos/photonstorm/phaser/issues/3884/comments","events_url":"https://api.github.com/repos/photonstorm/phaser/issues/3884/events","html_url":"https://github.com/photonstorm/phaser/issues/3884","id":346776494,"node_id":"MDU6SXNzdWUzNDY3NzY0OTQ=","number":3884,"title":"Wrong rectangle's right/bottom coordinates","user":{"login":"imilo","id":8048912,"node_id":"MDQ6VXNlcjgwNDg5MTI=","avatar_url":"https://avatars1.githubusercontent.com/u/8048912?v=4","gravatar_id":"","url":"https://api.github.com/users/imilo","html_url":"https://github.com/imilo","followers_url":"https://api.github.com/users/imilo/followers","following_url":"https://api.github.com/users/imilo/following{/other_user}","gists_url":"https://api.github.com/users/imilo/gists{/gist_id}","starred_url":"https://api.github.com/users/imilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imilo/subscriptions","organizations_url":"https://api.github.com/users/imilo/orgs","repos_url":"https://api.github.com/users/imilo/repos","events_url":"https://api.github.com/users/imilo/events{/privacy}","received_events_url":"https://api.github.com/users/imilo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-01T21:29:55Z","updated_at":"2018-08-02T09:25:41Z","closed_at":"2018-08-02T09:25:41Z","author_association":"NONE","body":"Hello!\r\n\r\nI've noticed a little wrong calculations of the rectangle's borders. Simple code example:\r\n```javascript\r\nvar config = {\r\n    type: Phaser.AUTO,\r\n    width: 800,\r\n    height: 600,\r\n    parent: 'phaser-example',\r\n    scene: {\r\n        create: create\r\n    }\r\n};\r\n\r\nvar game = new Phaser.Game(config);\r\n\r\nfunction create ()\r\n{\r\n    var rect = new Phaser.Geom.Rectangle(0, 0, 2, 2);\r\n    console.log(rect);\r\n}\r\n```\r\n\r\nConsole says:\r\n```\r\nRectangle {x: 0, y: 0, width: 2, height: 2}\r\n    bottom: 2\r\n    centerX: 1\r\n    centerY: 1\r\n    height: 2\r\n    left: 0\r\n    right: 2\r\n    top: 0\r\n    width: 2\r\n    x: 0\r\n    y: 0\r\n```\r\n\r\nTheoretically, if a rectangle starts at position **0** and it's width is **2** - it's **right** coord. should be **1**, isn't it? Because this rectangle takes exactly 2 pixels: 0'th and 1'st, but not the 2'nd. Same with the bottom.\r\n\r\n---\r\n\r\nP.S. Why this 1 pixel is still important - when there are 2 objects next to each other, pixel to pixel, function `Phaser.Geom.Intersects.RectangleToRectangle()` returns **True**, but it should be **False**.\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/61621387-wrong-rectangle-s-right-bottom-coordinates?utm_campaign=plugin&utm_content=tracker%2F283654&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F283654&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"}}
{"actor":{"display_login":"photonstorm"}}