summaryrefslogtreecommitdiffhomepage
path: root/editor/imgui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/imgui.cpp')
-rw-r--r--editor/imgui.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp
index 6126dda0..4aca859e 100644
--- a/editor/imgui.cpp
+++ b/editor/imgui.cpp
@@ -5,6 +5,7 @@
#include "world.hpp"
#include "scenery.hpp"
#include "inspect.hpp"
+#include "main/clickable.hpp"
#include <Magnum/Math/Color.h>
namespace floormat {
@@ -155,12 +156,9 @@ void app::draw_inspector()
auto b = push_id("inspector");
auto& w = M->world();
- if (cursor.tile)
- {
- auto [c, t] = w[*cursor.tile];
- if (auto s = t.scenery())
- tile = *cursor.tile;
- }
+ if (cursor.pixel)
+ if (const auto* sc = find_clickable_scenery(cursor.pixel))
+ tile = {InPlaceInit, sc->chunk, sc->pos};
if (tile)
{
auto [c, t] = w[*tile];