From 10fd75c8335736b1a0dcb3830a5b8c2367a02e61 Mon Sep 17 00:00:00 2001 From: Nicola Guerrera Date: Sat, 10 Jun 2023 23:00:41 +0200 Subject: [PATCH] zoom: multiply by scale only on mouseZoomUseMouse (#2495) --- src/render/OpenGL.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 545b1250..dd0cd3f9 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -158,9 +158,8 @@ void CHyprOpenGLImpl::end() { wlr_box monbox = {0, 0, m_RenderData.pMonitor->vecTransformedSize.x, m_RenderData.pMonitor->vecTransformedSize.y}; if (m_RenderData.mouseZoomFactor != 1.f) { - const auto ZOOMCENTER = (m_RenderData.mouseZoomUseMouse ? g_pInputManager->getMouseCoordsInternal() - m_RenderData.pMonitor->vecPosition : - m_RenderData.pMonitor->vecTransformedSize / 2.f) * - m_RenderData.pMonitor->scale; + const auto ZOOMCENTER = m_RenderData.mouseZoomUseMouse ? (g_pInputManager->getMouseCoordsInternal() - m_RenderData.pMonitor->vecPosition) * m_RenderData.pMonitor->scale : + m_RenderData.pMonitor->vecTransformedSize / 2.f; monbox.x -= ZOOMCENTER.x; monbox.y -= ZOOMCENTER.y; scaleBox(&monbox, m_RenderData.mouseZoomFactor);