summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-02-28 15:00:34 +0000
committerVaxry <vaxry@vaxry.net>2024-02-28 15:00:40 +0000
commit4bc669f9331bb66ab30bd705d09f1239bc3e83ed (patch)
tree0ffdfa24b039b601080c6a49699a8d73b779ed8a /src/render/OpenGL.cpp
parentf4f3aa2e505ca1b22688fb4a32f31c4bfb851dd0 (diff)
layers: add fully featured animations
Adds configs and layerrules to handle them alas fixes #981 I have cooked
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 1a53ec39..90e92e25 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -1812,13 +1812,22 @@ void CHyprOpenGLImpl::renderSnapshot(SLayerSurface** pLayer) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(PLAYER->monitorID);
- CBox monbox = {0, 0, PMONITOR->vecTransformedSize.x, PMONITOR->vecTransformedSize.y};
+ CBox layerBox;
+ // some mafs to figure out the correct box
+ // the originalClosedPos is relative to the monitor's pos
+ Vector2D scaleXY = Vector2D((PMONITOR->scale * PLAYER->realSize.vec().x / (PLAYER->geometry.w * PMONITOR->scale)),
+ (PMONITOR->scale * PLAYER->realSize.vec().y / (PLAYER->geometry.h * PMONITOR->scale)));
- CRegion fakeDamage{0, 0, PMONITOR->vecTransformedSize.x, PMONITOR->vecTransformedSize.y};
+ layerBox.width = PMONITOR->vecTransformedSize.x * scaleXY.x;
+ layerBox.height = PMONITOR->vecTransformedSize.y * scaleXY.y;
+ layerBox.x = ((PLAYER->realPosition.vec().x - PMONITOR->vecPosition.x) * PMONITOR->scale) - (((PLAYER->geometry.x - PMONITOR->vecPosition.x) * PMONITOR->scale) * scaleXY.x);
+ layerBox.y = ((PLAYER->realPosition.vec().y - PMONITOR->vecPosition.y) * PMONITOR->scale) - (((PLAYER->geometry.y - PMONITOR->vecPosition.y) * PMONITOR->scale) * scaleXY.y);
+
+ CRegion fakeDamage{0, 0, PMONITOR->vecTransformedSize.x, PMONITOR->vecTransformedSize.y};
m_bEndFrame = true;
- renderTextureInternalWithDamage(it->second.m_cTex, &monbox, PLAYER->alpha.fl(), &fakeDamage, 0);
+ renderTextureInternalWithDamage(it->second.m_cTex, &layerBox, PLAYER->alpha.fl(), &fakeDamage, 0);
m_bEndFrame = false;
}