From fd27a41c080a7697ebd1481dcc141ee57f292d57 Mon Sep 17 00:00:00 2001 From: bbbradsmith Date: Thu, 27 Jul 2023 01:04:48 -0400 Subject: [PATCH] relocate pattern mouse release handling to FurnaceGui::Loop --- src/gui/gui.cpp | 15 +++++++++++++++ src/gui/pattern.cpp | 14 -------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 3da07580d..d1ba5d2f5 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -4488,6 +4488,21 @@ bool FurnaceGUI::loop() { MEASURE(effectList,drawEffectList()); } + // release selection if mouse released + if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && selecting) { + if (!selectingFull) cursor=selEnd; + finishSelection(); + if (!mobileUI) { + demandScrollX=true; + if (cursor.xCoarse==selStart.xCoarse && cursor.xFine==selStart.xFine && cursor.y==selStart.y && + cursor.xCoarse==selEnd.xCoarse && cursor.xFine==selEnd.xFine && cursor.y==selEnd.y) { + if (!settings.cursorMoveNoScroll) { + updateScroll(cursor.y); + } + } + } + } + activateTutorial(GUI_TUTORIAL_OVERVIEW); if (inspectorOpen) ImGui::ShowMetricsWindow(&inspectorOpen); diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index ddce32a6e..0abd2a969 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -934,20 +934,6 @@ void FurnaceGUI::drawPattern() { ImGui::TableNextColumn(); } } - // release selection if mouse released - if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && selecting) { - if (!selectingFull) cursor=selEnd; - finishSelection(); - if (!mobileUI) { - demandScrollX=true; - if (cursor.xCoarse==selStart.xCoarse && cursor.xFine==selStart.xFine && cursor.y==selStart.y && - cursor.xCoarse==selEnd.xCoarse && cursor.xFine==selEnd.xFine && cursor.y==selEnd.y) { - if (!settings.cursorMoveNoScroll) { - updateScroll(cursor.y); - } - } - } - } ImGui::EndDisabled(); ImGui::PopStyleVar();