Skip to content

Commit

Permalink
avoid false positives when toolkit first starts up
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Feb 8, 2024
1 parent 9753ef9 commit 6c4459a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions haxe/ui/backend/ComponentBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ class ComponentBase extends ComponentSurface implements IClonable<ComponentBase>

@:noCompletion
private function checkComponentBounds(checkNextFrame:Bool = true) {
if (Screen.instance.currentMouseX == null || Screen.instance.currentMouseY == null) {
return;
}
// 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)) {
Expand Down

0 comments on commit 6c4459a

Please sign in to comment.