From 9d212216171f69eaf40f3aa408abcff932f8421a Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Mon, 10 Dec 2018 20:54:32 +0100 Subject: [PATCH] TextureViewer: fix wheel zooming on HiDPI screens Without adjusting for pixel ratio it zoomed in into a wrong place. --- qrenderdoc/Windows/TextureViewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/Windows/TextureViewer.cpp b/qrenderdoc/Windows/TextureViewer.cpp index 6fa5b4ac3..257fcd74a 100644 --- a/qrenderdoc/Windows/TextureViewer.cpp +++ b/qrenderdoc/Windows/TextureViewer.cpp @@ -2207,7 +2207,8 @@ void TextureViewer::render_mouseWheel(QWheelEvent *e) // scroll in logarithmic scale double logScale = logf(m_TexDisplay.scale); logScale += e->delta() / 2500.0; - UI_SetScale((float)expf(logScale), cursorPos.x(), cursorPos.y()); + UI_SetScale((float)expf(logScale), cursorPos.x() * ui->render->devicePixelRatio(), + cursorPos.y() * ui->render->devicePixelRatio()); e->accept(); }