mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
GUI: fix scrollbars not working
This commit is contained in:
parent
dacbeed858
commit
dca2aec606
2 changed files with 6 additions and 2 deletions
|
@ -1243,7 +1243,9 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue