{"action":"created","issue":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/1116","repository_url":"https://api.github.com/repos/paperjs/paper.js","labels_url":"https://api.github.com/repos/paperjs/paper.js/issues/1116/labels{/name}","comments_url":"https://api.github.com/repos/paperjs/paper.js/issues/1116/comments","events_url":"https://api.github.com/repos/paperjs/paper.js/issues/1116/events","html_url":"https://github.com/paperjs/paper.js/issues/1116","id":166821957,"number":1116,"title":"Wrong handling of inside contour points with CompoundPath#contains() and #fillRule = 'evenodd'","user":{"login":"lehni","id":213275,"avatar_url":"https://avatars.githubusercontent.com/u/213275?v=3","gravatar_id":"","url":"https://api.github.com/users/lehni","html_url":"https://github.com/lehni","followers_url":"https://api.github.com/users/lehni/followers","following_url":"https://api.github.com/users/lehni/following{/other_user}","gists_url":"https://api.github.com/users/lehni/gists{/gist_id}","starred_url":"https://api.github.com/users/lehni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehni/subscriptions","organizations_url":"https://api.github.com/users/lehni/orgs","repos_url":"https://api.github.com/users/lehni/repos","events_url":"https://api.github.com/users/lehni/events{/privacy}","received_events_url":"https://api.github.com/users/lehni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paperjs/paper.js/labels/cat:%20hit-testing","name":"cat: hit-testing","color":"c7def8"},{"url":"https://api.github.com/repos/paperjs/paper.js/labels/type:%20bug","name":"type: bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"lehni","id":213275,"avatar_url":"https://avatars.githubusercontent.com/u/213275?v=3","gravatar_id":"","url":"https://api.github.com/users/lehni","html_url":"https://github.com/lehni","followers_url":"https://api.github.com/users/lehni/followers","following_url":"https://api.github.com/users/lehni/following{/other_user}","gists_url":"https://api.github.com/users/lehni/gists{/gist_id}","starred_url":"https://api.github.com/users/lehni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehni/subscriptions","organizations_url":"https://api.github.com/users/lehni/orgs","repos_url":"https://api.github.com/users/lehni/repos","events_url":"https://api.github.com/users/lehni/events{/privacy}","received_events_url":"https://api.github.com/users/lehni/received_events","type":"User","site_admin":false},"assignees":[{"login":"lehni","id":213275,"avatar_url":"https://avatars.githubusercontent.com/u/213275?v=3","gravatar_id":"","url":"https://api.github.com/users/lehni","html_url":"https://github.com/lehni","followers_url":"https://api.github.com/users/lehni/followers","following_url":"https://api.github.com/users/lehni/following{/other_user}","gists_url":"https://api.github.com/users/lehni/gists{/gist_id}","starred_url":"https://api.github.com/users/lehni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehni/subscriptions","organizations_url":"https://api.github.com/users/lehni/orgs","repos_url":"https://api.github.com/users/lehni/repos","events_url":"https://api.github.com/users/lehni/events{/privacy}","received_events_url":"https://api.github.com/users/lehni/received_events","type":"User","site_admin":false}],"milestone":null,"comments":30,"created_at":"2016-07-21T13:40:38Z","updated_at":"2016-07-22T15:09:21Z","closed_at":null,"body":"@iconexperience unfortunately I have not only good news, but hopefully this one will be easy to resolve:\r\n\r\nI've improved the `CompoundPath#contains() (donut)` test to check for different combinations of `fillRule` and `resolve()`, and I'm seeing some weird behavior with the `nonzero` fill-rule.\r\n\r\nYou can reproduce this is in the test suite, by uncommenting this line of code:\r\n\r\nhttps://github.com/paperjs/paper.js/blob/develop/test/tests/PathItem_Contains.js#L138\r\n\r\nAnd here a simple example:\r\n\r\n```js\r\nview.center = [0, 0];\r\n\r\nvar path = new CompoundPath({\r\n    children: [\r\n        new Path.Circle([0, 0], 50),\r\n        new Path.Circle([0, 0], 25)\r\n    ],\r\n    fillColor: 'blue',\r\n    fillRule: 'evenodd'\r\n});\r\n\r\nvar point = new Point(-25, 0);\r\n\r\nnew Path.Circle({\r\n    center: point,\r\n    radius: 3,\r\n    strokeColor: 'red'\r\n});\r\n\r\nconsole.log(path.contains(point)); // false\r\npath.fillRule = 'nonzero';\r\npath.reorient();\r\nconsole.log(path.contains(point)); // true\r\n```\r\n\r\nThe shape looks the same in both cases...\r\n\r\nAnd here the lines of code, that handles nonzero fill rule in `contains()`:\r\n\r\nhttps://github.com/paperjs/paper.js/blob/develop/src/path/PathItem.js#L269\r\n```js\r\n        var winding = point.isInside(\r\n                this.getBounds({ internal: true, handle: true }))\r\n                    && this._getWinding(point);\r\n        return !!(this.getFillRule() === 'evenodd' ? winding & 1 : winding);\r\n```\r\n\r\nIs it a problem of `getWinding()` returning the wrong winding contribution?"},"comment":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/comments/234570008","html_url":"https://github.com/paperjs/paper.js/issues/1116#issuecomment-234570008","issue_url":"https://api.github.com/repos/paperjs/paper.js/issues/1116","id":234570008,"user":{"login":"iconexperience","id":2122773,"avatar_url":"https://avatars.githubusercontent.com/u/2122773?v=3","gravatar_id":"","url":"https://api.github.com/users/iconexperience","html_url":"https://github.com/iconexperience","followers_url":"https://api.github.com/users/iconexperience/followers","following_url":"https://api.github.com/users/iconexperience/following{/other_user}","gists_url":"https://api.github.com/users/iconexperience/gists{/gist_id}","starred_url":"https://api.github.com/users/iconexperience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iconexperience/subscriptions","organizations_url":"https://api.github.com/users/iconexperience/orgs","repos_url":"https://api.github.com/users/iconexperience/repos","events_url":"https://api.github.com/users/iconexperience/events{/privacy}","received_events_url":"https://api.github.com/users/iconexperience/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T15:09:20Z","updated_at":"2016-07-22T15:09:20Z","body":"Nice, so we could then remove the tangent check in propagate winding? Makes a lot of sense to me."}}
{"actor":{"display_login":"iconexperience"}}