diff --git a/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp b/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp index 435e8d5..9e69bbd 100644 --- a/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp +++ b/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp @@ -257,11 +257,11 @@ void WorldEditorImGui::handleSelection(ox::Size const&paneSz, float fbPaneScale) auto const scaledViewSz = static_cast(m_view.drawSize()) * fbPaneScale; m_selTracker.updateCursorPoint(fbPtToTileAddr(fbPos, scaledViewSz), startSel); if (m_selTracker.selectionOngoing()) { - m_selection.emplace(m_selTracker.selection()); - m_view.setSelection(*m_selection); + m_view.setSelection(m_selTracker.selection()); } - } else if (io.MouseReleased[0]) { + } else if (io.MouseReleased[0] && m_selTracker.selectionOngoing()) { m_selTracker.finishSelection(); + m_selection.emplace(m_selTracker.selection()); } if (io.KeyCtrl && io.KeysDown[ImGuiKey_G]) { m_selection.reset();