summaryrefslogtreecommitdiffhomepage
path: root/editor/draw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/draw.cpp')
-rw-r--r--editor/draw.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/editor/draw.cpp b/editor/draw.cpp
index 9915a93e..17be7aeb 100644
--- a/editor/draw.cpp
+++ b/editor/draw.cpp
@@ -35,21 +35,21 @@ void app::draw_cursor()
void app::draw()
{
- draw_cursor();
+ if (_editor.current_tile_editor())
+ draw_cursor();
draw_ui();
render_menu();
}
-clickable_scenery* app::find_clickable_scenery()
+clickable_scenery* app::find_clickable_scenery(Vector2i pixel_)
{
+ clickable_scenery* item = nullptr;
if (cursor.tile)
{
- float depth = -2;
- clickable_scenery* item = nullptr;
+ float depth = -1;
auto array = M->clickable_scenery();
- const auto pixel = Vector2ui(*cursor.pixel);
+ const auto pixel = Vector2ui(pixel_);
for (clickable_scenery& c : array)
- {
if (c.depth > depth && c.dest.contains(pixel))
{
const auto pos = pixel - c.dest.min() + c.src.min();
@@ -62,10 +62,8 @@ clickable_scenery* app::find_clickable_scenery()
item = &c;
}
}
- }
- return item;
}
- return nullptr;
+ return item;
}
} // namespace floormat