Skip to content

Fix rays outside the box - #1

Open
bossmc wants to merge 1 commit into
krisajenkins:masterfrom
bossmc:master
Open

Fix rays outside the box#1
bossmc wants to merge 1 commit into
krisajenkins:masterfrom
bossmc:master

Conversation

@bossmc

@bossmc bossmc commented May 27, 2016

Copy link
Copy Markdown

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