From 6d0a594e618f165eb2823bb31eb3cfe21ec1e7c5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 3 Mar 2023 17:30:04 +0100 Subject: editor, main: random crap --- editor/draw.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'editor/draw.cpp') diff --git a/editor/draw.cpp b/editor/draw.cpp index 92f0ea47..9f113e71 100644 --- a/editor/draw.cpp +++ b/editor/draw.cpp @@ -152,11 +152,12 @@ clickable* app::find_clickable_scenery(const Optional& pixel) return nullptr; clickable* item = nullptr; - float depth = -1; + float depth = -(1 << 24); const auto array = M->clickable_scenery(); + const auto p = *pixel; for (clickable& c : array) - if (c.depth > depth && c.dest.contains(*pixel)) + if (c.depth > depth && c.dest.contains(p)) { const auto pos_ = *pixel - c.dest.min() + Vector2i(c.src.min()); const auto pos = !c.mirrored ? pos_ : Vector2i(int(c.src.sizeX()) - 1 - pos_[0], pos_[1]); -- cgit v1.2.3