Skip to content

Commit

Permalink
dont allow zero sized items to be included in findComponentsUnderPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Aug 9, 2022
1 parent d0a7672 commit e70bd51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions haxe/ui/core/Component.hx
Original file line number Diff line number Diff line change
Expand Up @@ -820,9 +820,9 @@ class Component extends ComponentImpl implements IValidating {

public function findComponentsUnderPoint<T:Component>(screenX:Float, screenY:Float, type:Class<T> = null):Array<Component> {
var c:Array<Component> = [];
if (hitTest(screenX, screenY, true)) {
if (hitTest(screenX, screenY, false)) {
for (child in childComponents) {
if (child.hitTest(screenX, screenY, true)) {
if (child.hitTest(screenX, screenY, false)) {
var match = true;
if (type != null && isOfType(child, type) == false) {
match = false;
Expand All @@ -839,12 +839,12 @@ class Component extends ComponentImpl implements IValidating {

public function hasComponentUnderPoint<T:Component>(screenX:Float, screenY:Float, type:Class<T> = null):Bool {
var b = false;
if (hitTest(screenX, screenY, true)) {
if (hitTest(screenX, screenY, false)) {
if (type == null) {
return true;
}
for (child in childComponents) {
if (child.hitTest(screenX, screenY, true)) {
if (child.hitTest(screenX, screenY, false)) {
var match = true;
if (type != null && isOfType(child, type) == false) {
match = false;
Expand Down

0 comments on commit e70bd51

Please sign in to comment.