diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-29 13:08:28 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-29 13:08:28 +0200 |
| commit | 697ce96d624923ccda9e6d4f1d6081005e43f306 (patch) | |
| tree | 94fd26e9dc20404a23d608731098627543ed7d30 /src/render | |
| parent | 31a1b3b1928419ccfea984aeee6e59dbe612fe90 (diff) | |
temp fix for snapshot size on scaled
Diffstat (limited to 'src/render')
| -rw-r--r-- | src/render/OpenGL.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 94267c19..75336f5a 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -820,6 +820,11 @@ void CHyprOpenGLImpl::renderSnapshot(CWindow** pWindow) { windowBox.x = (PWINDOW->m_vRealPosition.vec().x * PMONITOR->scale - PMONITOR->vecPosition.x) - ((PWINDOW->m_vOriginalClosedPos.x - PMONITOR->vecPosition.x) * scaleXY.x); windowBox.y = (PWINDOW->m_vRealPosition.vec().y * PMONITOR->scale - PMONITOR->vecPosition.y) - ((PWINDOW->m_vOriginalClosedPos.y - PMONITOR->vecPosition.y) * scaleXY.y); + if (scaleXY != Vector2D(1, 1) && PMONITOR->scale != 1) { // TODO: this is completely wrong but I suck at math. + windowBox.width /= PMONITOR->scale; + windowBox.height /= PMONITOR->scale; + } + pixman_region32_t fakeDamage; pixman_region32_init_rect(&fakeDamage, 0, 0, PMONITOR->vecPixelSize.x, PMONITOR->vecPixelSize.y); |
