Skip to content

Commit

Permalink
Merge pull request #566 from Starmapo/hit-test-no-hidden
Browse files Browse the repository at this point in the history
Always return false in `hitTest` if component is hidden
  • Loading branch information
ianharrigan authored Jan 18, 2024
2 parents 5bb138a + ad2b1b1 commit 67e7b91
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions haxe/ui/core/Component.hx
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,20 @@ class Component extends ComponentImpl
return cast match;
}

/**
Whether or not a point is inside this components bounds
*Note*: `left` and `top` must be stage (screen) co-ords
**/
@:dox(group = "Size related properties and methods")
public override function hitTest(left:Null<Float>, top:Null<Float>, allowZeroSized:Bool = false):Bool { // co-ords must be stage
if (hidden) {
return false;
}

return super.hitTest(left, top, allowZeroSized);
}

/**
* Lists components under a specific point in global, screen coordinates.
*
Expand Down

0 comments on commit 67e7b91

Please sign in to comment.