From be861664bcc71b28f8a52ce2cf65fcd32206f6f2 Mon Sep 17 00:00:00 2001 From: marmare314 <49279081+Marmare314@users.noreply.github.com> Date: Wed, 26 Jul 2023 09:34:36 +0200 Subject: [PATCH] reset layer dragging status if no buttons were pressed --- src/game/editor/editor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 973c25c79..df611311b 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -3582,6 +3582,7 @@ void CEditor::RenderLayers(CUIRect LayersBox) bool MoveGroup = false; bool StartDragLayer = false; bool StartDragGroup = false; + bool AnyButtonActive = false; std::vector vButtonsPerGroup; vButtonsPerGroup.reserve(m_Map.m_vpGroups.size()); @@ -3683,6 +3684,8 @@ void CEditor::RenderLayers(CUIRect LayersBox) if(int Result = DoButton_DraggableEx(&m_Map.m_vpGroups[g], aBuf, g == m_SelectedGroup, &Slot, &Clicked, &Abrupted, BUTTON_CONTEXT, m_Map.m_vpGroups[g]->m_Collapse ? "Select group. Shift click to select all layers. Double click to expand." : "Select group. Shift click to select all layers. Double click to collapse.", IGraphics::CORNER_R)) { + AnyButtonActive = true; + if(s_Operation == OP_NONE) { s_InitialMouseY = UI()->MouseY(); @@ -3833,6 +3836,8 @@ void CEditor::RenderLayers(CUIRect LayersBox) if(int Result = DoButton_DraggableEx(m_Map.m_vpGroups[g]->m_vpLayers[i], aBuf, Checked, &Button, &Clicked, &Abrupted, BUTTON_CONTEXT, "Select layer. Shift click to select multiple.", IGraphics::CORNER_R)) { + AnyButtonActive = true; + if(s_Operation == OP_NONE) { s_InitialMouseY = UI()->MouseY(); @@ -4099,6 +4104,9 @@ void CEditor::RenderLayers(CUIRect LayersBox) } s_ScrollRegion.End(); + + if(!AnyButtonActive) + s_Operation = OP_NONE; } bool CEditor::SelectLayerByTile()