From 14d3baae5676ca8bc5f5c55a9d9340345126a51d Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 19 Aug 2023 16:25:08 -0500 Subject: [PATCH] GUI: invert cursor follows wheel issue #1374 --- src/gui/pattern.cpp | 2 +- src/gui/settings.cpp | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index a1ba6336f..b5e92b598 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -950,7 +950,7 @@ void FurnaceGUI::drawPattern() { // cursor follows wheel if (settings.cursorFollowsWheel && (!e->isPlaying() || !followPattern) && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows)) { if (wheelX!=0 || wheelY!=0) { - moveCursor(wheelX,wheelY,false); + moveCursor(wheelX,(settings.cursorFollowsWheel==2)?wheelY:-wheelY,false); } } diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 221b96957..4ceb6fb6c 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -1972,10 +1972,18 @@ void FurnaceGUI::drawSettings() { settings.cursorMoveNoScroll=cursorMoveNoScrollB; } - bool cursorFollowsWheelB=settings.cursorFollowsWheel; - if (ImGui::Checkbox("Move cursor with scroll wheel",&cursorFollowsWheelB)) { - settings.cursorFollowsWheel=cursorFollowsWheelB; + ImGui::Text("Move cursor with scroll wheel:"); + ImGui::Indent(); + if (ImGui::RadioButton("No##csw0",settings.cursorFollowsWheel==0)) { + settings.cursorFollowsWheel=0; } + if (ImGui::RadioButton("Yes##csw1",settings.cursorFollowsWheel==1)) { + settings.cursorFollowsWheel=1; + } + if (ImGui::RadioButton("Inverted##csw2",settings.cursorFollowsWheel==2)) { + settings.cursorFollowsWheel=2; + } + ImGui::Unindent(); END_SECTION; } @@ -3292,7 +3300,7 @@ void FurnaceGUI::syncSettings() { clampSetting(settings.pullDeleteRow,0,1); clampSetting(settings.newSongBehavior,0,1); clampSetting(settings.memUsageUnit,0,1); - clampSetting(settings.cursorFollowsWheel,0,1); + clampSetting(settings.cursorFollowsWheel,0,2); clampSetting(settings.noDMFCompat,0,1); clampSetting(settings.removeInsOff,0,1); clampSetting(settings.removeVolOff,0,1);