GUI: fix pitch indicators in visualizer not aligni

ng with channels when the pattern view scroll X is not 0

issue #1184
This commit is contained in:
tildearrow 2023-07-07 03:25:34 -05:00
parent 97fec35b00
commit 06aa738782
1 changed files with 2 additions and 4 deletions

View File

@ -376,7 +376,6 @@ void FurnaceGUI::drawPattern() {
if (!patternOpen) return;
bool inhibitMenu=false;
float scrollX=0;
if (e->isPlaying() && followPattern && (!e->isStepping() || pendingStepUpdate)) {
cursor.y=oldRow+((pendingStepUpdate)?1:0);
@ -951,7 +950,6 @@ void FurnaceGUI::drawPattern() {
}
demandScrollX=false;
}
scrollX=ImGui::GetScrollX();
// overflow changes order
// TODO: this is very unreliable and sometimes it can warp you out of the song
@ -1182,8 +1180,8 @@ void FurnaceGUI::drawPattern() {
}
if (width>0.1) for (float j=-patChanSlideY[i]; j<ImGui::GetWindowHeight(); j+=width*0.7) {
ImVec2 tMin=ImVec2(off.x+patChanX[i]-scrollX,off.y+j);
ImVec2 tMax=ImVec2(off.x+patChanX[i+1]-scrollX,off.y+j+width*0.6);
ImVec2 tMin=ImVec2(off.x+patChanX[i],off.y+j);
ImVec2 tMax=ImVec2(off.x+patChanX[i+1],off.y+j+width*0.6);
if (ch->portaNote<=ch->note) {
arrowPoints[0]=ImLerp(tMin,tMax,ImVec2(0.1,1.0-0.8));
arrowPoints[1]=ImLerp(tMin,tMax,ImVec2(0.5,1.0-0.0));