mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
TextureViewer: fix wheel zooming on HiDPI screens
Without adjusting for pixel ratio it zoomed in into a wrong place.
This commit is contained in:
committed by
Baldur Karlsson
parent
bba5e6ee5e
commit
9d21221617
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user