summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-01-11 09:17:34 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-01-11 09:17:34 +0100
commit92888469084a1dd59733f5ff484c085d1b285926 (patch)
tree16373c36ef377a78e8053d8481e653068411d78e
parent32b4231d09f4c19dbcbf1f29ff66d109f11be1dd (diff)
a
-rw-r--r--editor/draw.cpp3
-rw-r--r--editor/editor.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/editor/draw.cpp b/editor/draw.cpp
index c9f82cdd..c4f6a8a2 100644
--- a/editor/draw.cpp
+++ b/editor/draw.cpp
@@ -202,7 +202,8 @@ void app::draw()
do_lightmap_test();
if (_render_bboxes)
draw_collision_boxes();
- if (_editor.current_ground_editor() || _editor.current_wall_editor() ||
+ if (_editor.current_ground_editor() && _editor.current_ground_editor()->is_anything_selected() ||
+ _editor.current_wall_editor() && _editor.current_wall_editor()->is_anything_selected() ||
_editor.current_scenery_editor() && _editor.current_scenery_editor()->is_anything_selected() ||
_editor.current_vobj_editor() && _editor.current_vobj_editor()->is_anything_selected())
draw_cursor();
diff --git a/editor/editor.cpp b/editor/editor.cpp
index 9f2761e2..de2e690e 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -17,6 +17,8 @@ void editor::clear_selection()
{
if (auto* ed = current_ground_editor())
ed->clear_selection();
+ else if (auto* wa = current_wall_editor())
+ wa->clear_selection();
else if (auto* ed = current_scenery_editor())
ed->clear_selection();
else if (auto* vo = current_vobj_editor())
@@ -100,7 +102,7 @@ Optional<global_coords> editor::mouse_drag_pos()
void editor::on_click_(world& world, global_coords pos, button b)
{
- if (auto* mode = current_ground_editor(); mode != nullptr)
+ if (auto* mode = current_ground_editor())
{
if (auto opt = mode->get_selected(); opt || b == button::remove)
{
@@ -112,7 +114,7 @@ void editor::on_click_(world& world, global_coords pos, button b)
}
}
}
- else if (auto* mode = current_wall_editor(); mode != nullptr)
+ else if (auto* mode = current_wall_editor())
{
if (auto opt = mode->get_selected(); opt || b == button::remove)
{