[jasper/world/studio] Make mouse release only finish selection if selection is ongoing
All checks were successful
Build / build (push) Successful in 3m11s

This commit is contained in:
Gary Talent 2024-05-25 22:41:03 -05:00
parent e75c51d614
commit 6e32d36c78

View File

@ -257,11 +257,11 @@ void WorldEditorImGui::handleSelection(ox::Size const&paneSz, float fbPaneScale)
auto const scaledViewSz = static_cast<ox::Vec2>(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();