From 015899a43f5c62250bbe7babd175aa31eaa44b5e Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 29 Aug 2023 18:54:08 -0500 Subject: [PATCH] GUI: fix cursor inconsistency after stop issue #1424 --- src/gui/gui.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 4ea2dbb86..f9c76d12b 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1103,10 +1103,21 @@ void FurnaceGUI::setOrder(unsigned char order, bool forced) { } void FurnaceGUI::stop() { + bool wasPlaying=e->isPlaying(); e->walkSong(loopOrder,loopRow,loopEnd); e->stop(); curNibble=false; orderNibble=false; + if (followPattern && wasPlaying) { + nextScroll=-1.0f; + nextAddScroll=0.0f; + cursor.y=e->getRow(); + if (selStart.xCoarse==selEnd.xCoarse && selStart.xFine==selEnd.xFine && selStart.y==selEnd.y && !selecting) { + selStart=cursor; + selEnd=cursor; + } + updateScroll(cursor.y); + } } void FurnaceGUI::previewNote(int refChan, int note, bool autoNote) {