zoom: multiply by scale only on mouseZoomUseMouse (#2495)

This commit is contained in:
Nicola Guerrera 2023-06-10 23:00:41 +02:00 committed by GitHub
parent 7932e42507
commit 10fd75c833
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);