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

Fix rays outside the box #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bossmc
Copy link

@bossmc bossmc commented May 27, 2016

I know you declared behaviour outside the box to be undefined (https://twitter.com/krisajenkins/status/726090881611227136) but that just sounded like a challenge 😀

The issue in the old code was that the triangle added to complete the circle doesn't make sense outside the square (logically, it's the ray that goes out to infinity off the side of the screen), this change only adds that triangle if the angle at the mouse pointer is under half a circle. This means that, so long as the bounding box in convex, the extra triangle won't ever get added outside the box (concave bounding boxes won't work when the pointer is in one of the "caves").

Not the most elegant fix to my mind, but I'm pretty new to elm, and the result is what I was going for, please suggest a more elegant fix if you think of one.

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

Successfully merging this pull request may close these issues.

1 participant