From 3cb9fbefaaac909601ade19331fb7f25859b64b2 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 28 Jun 2025 00:55:18 -0500 Subject: [PATCH] GUI: new pattern cursor logic, part 2 now it automatically changes order so you can select very far also fix a little bug --- src/gui/pattern.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index 002166fa3..44dc7c463 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -446,6 +446,7 @@ void FurnaceGUI::drawPattern() { sel1.xFine^=sel2.xFine; sel2.xFine^=sel1.xFine; } + ImVec2 origWinPadding=ImGui::GetStyle().WindowPadding; ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,ImVec2(0.0f,0.0f)); if (mobileUI) { @@ -517,7 +518,17 @@ void FurnaceGUI::drawPattern() { ImGui::TableSetupColumn("pos",ImGuiTableColumnFlags_WidthFixed,fourChars.x); if (nextAddScroll!=0.0f) { - ImGui::SetScrollY(ImGui::GetScrollY()+nextAddScroll); + float newScroll=ImGui::GetScrollY()+nextAddScroll; + // wrap around and go to previous/next pattern if we're about to overflow + if (newScroll<0.0f && curOrder>0) { + ImGui::SetScrollY(ImGui::GetScrollMaxY()+newScroll); + setOrder(curOrder-1); + } else if (newScroll>ImGui::GetScrollMaxY() && curOrder<(e->curSubSong->ordersLen-1)) { + ImGui::SetScrollY(newScroll-ImGui::GetScrollMaxY()); + setOrder(curOrder+1); + } else { + ImGui::SetScrollY(newScroll); + } nextScroll=-1.0f; nextAddScroll=0.0f; } @@ -1184,7 +1195,7 @@ void FurnaceGUI::drawPattern() { } ImGui::PushStyleVar(ImGuiStyleVar_Alpha,ImGui::GetStyle().Alpha*ImGui::GetStyle().DisabledAlpha); for (int i=0; icurSubSong->patLen+i-dummyRows+1,e->isPlaying(),lineHeight,chans,ord-1,patCache,true); + patternRow(e->curSubSong->patLen+i-dummyRows+1,e->isPlaying(),lineHeight,chans,ord-1,patCache,false); } ImGui::PopStyleVar(); } else {