diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index 663f50f86..17f581ceb 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -1243,7 +1243,9 @@ void FurnaceGUI::drawMacros(std::vector& macros) { if (i.macro->vScroll>((i.max-i.min)-i.macro->vZoom)) i.macro->vScroll=(i.max-i.min)-i.macro->vZoom; } - if (ImGui::ScrollbarEx(scrollbarPos,ImGui::GetID("IMacroVScroll"),ImGuiAxis_Y,&scrollV,availV,contentsV,0)) { + ImGuiID scrollbarID=ImGui::GetID("IMacroVScroll"); + ImGui::KeepAliveID(scrollbarID); + if (ImGui::ScrollbarEx(scrollbarPos,scrollbarID,ImGuiAxis_Y,&scrollV,availV,contentsV,0)) { i.macro->vScroll=(i.max-i.min-i.macro->vZoom)-scrollV; } } diff --git a/src/gui/sampleEdit.cpp b/src/gui/sampleEdit.cpp index 7737efbfd..327f93291 100644 --- a/src/gui/sampleEdit.cpp +++ b/src/gui/sampleEdit.cpp @@ -1349,7 +1349,9 @@ void FurnaceGUI::drawSampleEdit() { ImS64 availV=round(rectSize.x*sampleZoom); ImS64 contentsV=MAX(sample->samples,MAX(availV,1)); - if (ImGui::ScrollbarEx(ImRect(ImVec2(rectMin.x,rectMax.y),ImVec2(rectMax.x,rectMax.y+ImGui::GetStyle().ScrollbarSize)),ImGui::GetID("sampleScroll"),ImGuiAxis_X,&scrollV,availV,contentsV,0)) { + ImGuiID scrollbarID=ImGui::GetID("sampleScroll"); + ImGui::KeepAliveID(scrollbarID); + if (ImGui::ScrollbarEx(ImRect(ImVec2(rectMin.x,rectMax.y),ImVec2(rectMax.x,rectMax.y+ImGui::GetStyle().ScrollbarSize)),scrollbarID,ImGuiAxis_X,&scrollV,availV,contentsV,0)) { if (!sampleZoomAuto && samplePos!=scrollV) { samplePos=scrollV; updateSampleTex=true;