From a9bb65feef00d5d3654b2a6907a263564698cf06 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 4 Jan 2026 02:42:32 -0500 Subject: [PATCH] GUI: new pattern renderer, part 17 working visualizer --- src/gui/newPattern.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gui/newPattern.cpp b/src/gui/newPattern.cpp index a2054f5ff..770e7b716 100644 --- a/src/gui/newPattern.cpp +++ b/src/gui/newPattern.cpp @@ -1087,6 +1087,11 @@ void FurnaceGUI::drawPatternNew() { thisRowBg=ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_HI_1]); } + if (oldRow==row && ord==playOrder) { + // store playhead position + playheadY=pos.y; + } + if (thisRowBg) { dl->AddRectFilled( ImVec2(top.x+patChanX[0],pos.y), @@ -1392,14 +1397,14 @@ void FurnaceGUI::drawPatternNew() { // TODO: particles if (fancyPattern) { // visualizer e->getCommandStream(cmdStream); - ImVec2 off=ImVec2(0.0f,0.0f); + ImVec2 off=ImVec2(top.x,topHeaders.y); ImVec2 winMin=ImGui::GetWindowPos(); ImVec2 winMax=ImVec2( winMin.x+ImGui::GetWindowSize().x, winMin.y+ImGui::GetWindowSize().y ); - + // commands for (DivCommand& i: cmdStream) { if (i.cmd==DIV_CMD_PITCH) continue; @@ -1525,7 +1530,7 @@ void FurnaceGUI::drawPatternNew() { for (int j=0; jwinMax.x || partPos.y>winMax.y) continue; @@ -1577,7 +1582,7 @@ void FurnaceGUI::drawPatternNew() { )); } - if (width>0.1) for (float j=-patChanSlideY[i]; j0.1) for (float j=-patChanSlideY[i]; jportaNote<=ch->note) { @@ -1616,7 +1621,7 @@ void FurnaceGUI::drawPatternNew() { ImVec2 partPos=ImVec2( off.x+patChanX[i]+(width*0.5+0.5*sin(M_PI*(float)ch->vibratoPosGiant/64.0f)*width), - off.y+(ImGui::GetWindowHeight()*0.5f)+randRange(0,PAT_FONT_SIZE) + playheadY+randRange(lineHeight*0.5,lineHeight*1.5) ); if (!(partPos.xwinMax.x || partPos.y>winMax.y)) {