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; }