From 5630b69e64fd041c3c9d16ffe475c5e606b8641a Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 20 Apr 2022 15:29:07 -0500 Subject: [PATCH] GUI: fix selection being visible in dummy row area --- src/gui/gui.h | 2 +- src/gui/pattern.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/gui.h b/src/gui/gui.h index 88ced6b69..bea900687 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1101,7 +1101,7 @@ class FurnaceGUI { float calcBPM(int s1, int s2, float hz); - void patternRow(int i, bool isPlaying, float lineHeight, int chans, int ord, const DivPattern** patCache); + void patternRow(int i, bool isPlaying, float lineHeight, int chans, int ord, const DivPattern** patCache, bool inhibitSel); void actualWaveList(); void actualSampleList(); diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index 6f357bd8b..3b45cd27b 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -32,9 +32,9 @@ inline float randRange(float min, float max) { } // draw a pattern row -inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int chans, int ord, const DivPattern** patCache) { +inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int chans, int ord, const DivPattern** patCache, bool inhibitSel) { static char id[32]; - bool selectedRow=(i>=sel1.y && i<=sel2.y); + bool selectedRow=(i>=sel1.y && i<=sel2.y && !inhibitSel); ImGui::TableNextRow(0,lineHeight); ImGui::TableNextColumn(); float cursorPosY=ImGui::GetCursorPos().y-ImGui::GetScrollY(); @@ -559,7 +559,7 @@ void FurnaceGUI::drawPattern() { patCache[i]=e->song.pat[i].getPattern(e->song.orders.ord[i][ord-1],true); } for (int i=0; isong.patLen+i-dummyRows+1,e->isPlaying(),lineHeight,chans,ord-1,patCache); + patternRow(e->song.patLen+i-dummyRows+1,e->isPlaying(),lineHeight,chans,ord-1,patCache,true); } } else { for (int i=0; isong.pat[i].getPattern(e->song.orders.ord[i][ord],true); } for (int i=0; isong.patLen; i++) { - patternRow(i,e->isPlaying(),lineHeight,chans,ord,patCache); + patternRow(i,e->isPlaying(),lineHeight,chans,ord,patCache,false); } // next pattern ImGui::BeginDisabled(); @@ -582,7 +582,7 @@ void FurnaceGUI::drawPattern() { patCache[i]=e->song.pat[i].getPattern(e->song.orders.ord[i][ord+1],true); } for (int i=0; i<=dummyRows; i++) { - patternRow(i,e->isPlaying(),lineHeight,chans,ord+1,patCache); + patternRow(i,e->isPlaying(),lineHeight,chans,ord+1,patCache,true); } } else { for (int i=0; i<=dummyRows; i++) {