From bfbc9a3e48988d4b5e6b542c7c72909504b5cf70 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 4 Oct 2021 12:10:56 +0100 Subject: [PATCH] Fix order of scrollbar update when texture scale changes. Closes #2377 * We need to update the scrollbar bounds first based on the current zoom level, then change the scroll position. Otherwise the scroll will be visually correct but the scrollbars won't match. --- qrenderdoc/Windows/TextureViewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp index e62fcf91b..3eadb1638 100644 --- a/qrenderdoc/Windows/TextureViewer.cpp +++ b/qrenderdoc/Windows/TextureViewer.cpp @@ -3338,11 +3338,11 @@ void TextureViewer::UI_SetScale(float s, int x, int y) newPos = QPoint((int)(newPos.x() * scaleDelta), (int)(newPos.y() * scaleDelta)); newPos += QPoint(x, y); - setScrollPosition(newPos); - setCurrentZoomValue(m_TexDisplay.scale); UI_CalcScrollbars(); + + setScrollPosition(newPos); } void TextureViewer::setCurrentZoomValue(float zoom)