calculate zoom_center based on monitor scale (#2482)

This commit is contained in:
Nicola Guerrera 2023-06-10 12:28:00 +02:00 committed by GitHub
parent bca3068db2
commit 003993337a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -159,7 +159,7 @@ void CHyprOpenGLImpl::end() {
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.mouseZoomUseMouse ? g_pInputManager->getMouseCoordsInternal() - m_RenderData.pMonitor->vecPosition : m_RenderData.pMonitor->vecTransformedSize / 2.f) * m_RenderData.pMonitor->scale;
monbox.x -= ZOOMCENTER.x;
monbox.y -= ZOOMCENTER.y;
scaleBox(&monbox, m_RenderData.mouseZoomFactor);