Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential CompoundPath.contains bug #888

Closed
kevinmcvey opened this issue Jan 5, 2016 · 3 comments
Closed

Potential CompoundPath.contains bug #888

kevinmcvey opened this issue Jan 5, 2016 · 3 comments

Comments

@kevinmcvey
Copy link

Hey folks,

I believe I've encountered a bug in CompoundPath.contains in which, by inspection, it's clear that a CompoundPath does not contain a particular point but Paper.js is returning that it does. I've taken a crack at isolating what I believe to be the source of the problem and would greatly appreciate having more trained eyes looking into the matter.

Here's an example sketch demonstrating the potential bug

My suspicion is that this is related to the use of x-axis raycasting in order to determine containment. It's possible that there is a small error in in this process, particularly with curved lines, that causes a path to believe it contains any point with the same y value as its own starting point. Perhaps only one intersection is made with the curved line, instead of two, causing an even/odd check to return a different value than we would expect.

Please have a look at the test cases I provide in my sketch and let me know if there are any further questions about my issue I can answer. Thanks so much for the help!

@iconexperience
Copy link
Contributor

We had a similar bug recently (#819), which is closed now, but I am aware that this part of paper is not bullet proof yet and I guess it still contains bugs.

But please let us know if your bug still occurs with the latest code, as this part has seen quite a few changes recently. Be aware that Sketch is running on an old code base.

@kevinmcvey
Copy link
Author

I just switched to the current nightly build and the issue is resolved. Thanks for the help and quick work of my issue!

@iconexperience
Copy link
Contributor

Well, that was easy :) Please keep on testing an posting issues if you find anything, the boolean operations are almost finished and it would be great to find and close all remaining bugs now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants