Skip to content

Commit

Permalink
dont reverse when looking for components under point (ill conceived)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Aug 9, 2022
1 parent e70bd51 commit fbe8a15
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions haxe/ui/core/Screen.hx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ class Screen extends ScreenImpl {
}

public function findComponentsUnderPoint<T:Component>(screenX:Float, screenY:Float, type:Class<T> = null):Array<Component> {
var copy = rootComponents.copy();
copy.reverse();
var c:Array<Component> = [];
for (r in copy) {
for (r in rootComponents) {
if (r.hitTest(screenX, screenY)) {
var match = true;
if (type != null && isOfType(r, type) == false) {
Expand All @@ -108,9 +106,7 @@ class Screen extends ScreenImpl {
}

public function hasComponentUnderPoint<T:Component>(screenX:Float, screenY:Float, type:Class<T> = null):Bool {
var copy = rootComponents.copy();
copy.reverse();
for (r in copy) {
for (r in rootComponents) {
if (r.hasComponentUnderPoint(screenX, screenY, type) == true) {
return true;
}
Expand Down

0 comments on commit fbe8a15

Please sign in to comment.