GUI: fix scrollbars not working

This commit is contained in:
tildearrow 2022-05-20 21:57:41 -05:00
parent dacbeed858
commit dca2aec606
2 changed files with 6 additions and 2 deletions

View file

@ -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;