-
Notifications
You must be signed in to change notification settings - Fork 211
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
Incorrect result for horizontal line search #91
Comments
That's interesting! The code for this is copied from Rectangle2D.Double r = new Rectangle2D.Double(35.0d, -25.0d, 45.0d, -25.0d);
assertTrue(r.intersectsLine(40.0d, -20.0d, 45.0d, -40.0d)); Perhaps you've stumbled across a JDK bug? |
I found some information from JDK API doc. https://docs.oracle.com/javase/8/docs/api/java/awt/Rectangle.html
If a bound box has either zero-width or zero-height, the Java 2D would treat it as non-existence, thus any logical test gets failed on it. This behaviours might not be what we expected. |
Righto, thanks for finding that doc. I guess we are going to need some new code. Perhaps we just use |
Fixed by #92 |
Hi,
Thanks for this awesome library, with lots of cool features.
I found the search result for horizontal line is empty, might because it got a special bound box which height value is 0. Thus the RectangleUtil.outcode() always return OUT_TOP | OUT_BOTTOM.
Here's my test code:
The text was updated successfully, but these errors were encountered: