Skip to content

Commit

Permalink
Merge pull request #639 from Starmapo/fix-listview-mouse-over
Browse files Browse the repository at this point in the history
Fix mouse over detection for `checkComponentBounds()`
  • Loading branch information
ianharrigan authored Oct 7, 2024
2 parents b928f5c + aab3dec commit 3828546
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions haxe/ui/backend/ComponentBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,12 @@ class ComponentBase extends ComponentSurface implements IClonable<ComponentBase>
}
// is it valid to assume it must have :hover?
var hasHover = cast(this, Component).hasClass(":hover"); // TODO: might want to move "hasClass" et al to this class to avoid cast
if (!hasHover && screenBounds.containsPoint(Screen.instance.currentMouseX, Screen.instance.currentMouseY)) {
if (!hasHover && hitTest(Screen.instance.currentMouseX, Screen.instance.currentMouseY)) {
var mouseEvent = new MouseEvent(MouseEvent.MOUSE_OVER);
mouseEvent.screenX = Screen.instance.currentMouseX;
mouseEvent.screenY = Screen.instance.currentMouseY;
dispatch(mouseEvent);
} else if (hasHover && !screenBounds.containsPoint(Screen.instance.currentMouseX, Screen.instance.currentMouseY)) {
} else if (hasHover && !hitTest(Screen.instance.currentMouseX, Screen.instance.currentMouseY)) {
var mouseEvent = new MouseEvent(MouseEvent.MOUSE_OUT);
mouseEvent.screenX = Screen.instance.currentMouseX;
mouseEvent.screenY = Screen.instance.currentMouseY;
Expand Down

0 comments on commit 3828546

Please sign in to comment.