From fbe8a1572b3757815708fda007c2e7c05d76a8d4 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Tue, 9 Aug 2022 22:42:13 +0200 Subject: [PATCH] dont reverse when looking for components under point (ill conceived) --- haxe/ui/core/Screen.hx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/haxe/ui/core/Screen.hx b/haxe/ui/core/Screen.hx index bac9a15b0..f9329f890 100644 --- a/haxe/ui/core/Screen.hx +++ b/haxe/ui/core/Screen.hx @@ -89,10 +89,8 @@ class Screen extends ScreenImpl { } public function findComponentsUnderPoint(screenX:Float, screenY:Float, type:Class = null):Array { - var copy = rootComponents.copy(); - copy.reverse(); var c:Array = []; - for (r in copy) { + for (r in rootComponents) { if (r.hitTest(screenX, screenY)) { var match = true; if (type != null && isOfType(r, type) == false) { @@ -108,9 +106,7 @@ class Screen extends ScreenImpl { } public function hasComponentUnderPoint(screenX:Float, screenY:Float, type:Class = 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; }