TextureViewer: fix wheel zooming on HiDPI screens

Without adjusting for pixel ratio it zoomed in into a wrong place.
This commit is contained in:
Sebastian Krzyszkowiak
2018-12-10 20:54:32 +01:00
committed by Baldur Karlsson
parent bba5e6ee5e
commit 9d21221617
+2 -1
View File
@@ -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();
}