johnfn / Illumination

2 stars 0 forks source link

Strange behavior with DirectionPanel #23

Closed dwu4 closed 13 years ago

dwu4 commented 14 years ago

I am observing strange behavior with the direction panel. Clicking on certain regions of the buttons either does nothing or change the direction to something different... I suspect a problem/inconsistency with the coordinates specified in DirectionPanel

hhcho commented 14 years ago

It's actually because the bounding box is rectangular while the buttons appear to be diamond shape. So there are overlapping regions within the buttons. Is it possible to add a mouse listener to a non-rectangular domain? Or we'll just have to move around the buttons to avoid this kind of problem.

dwu4 commented 14 years ago

Yea... that's what I thought was causing the bug. I think the best fix is to modify the button event trigger - it checks whether the click occurred within a certain, defined region of the button before deciding whether to trigger the action or not.

dwu4 commented 13 years ago

Arbitrary polygons may now be specified as clickable regions for buttons.