From 610c59dc34225bad1c610388e43e8937276e43ff Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 27 Dec 2025 20:18:50 +0100 Subject: opengl: properly combine transforms in renderTexture ref #12666 --- src/render/OpenGL.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/render/OpenGL.cpp') diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 9a5d6ad0..33e380e1 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -1640,10 +1640,11 @@ void CHyprOpenGLImpl::renderTextureInternal(SP tex, const CBox& box, c static const auto PCURSORTIMEOUT = CConfigValue("cursor:inactive_timeout"); // get the needed transform for this texture - const bool TRANSFORMS_MATCH = Math::wlTransformToHyprutils(m_renderData.pMonitor->m_transform) == tex->m_transform; // FIXME: combine them properly!!! - eTransform TRANSFORM = HYPRUTILS_TRANSFORM_NORMAL; - if (m_monitorTransformEnabled || TRANSFORMS_MATCH) - TRANSFORM = Math::wlTransformToHyprutils(Math::invertTransform(m_renderData.pMonitor->m_transform)); + const auto MONITOR_INVERTED = Math::wlTransformToHyprutils(Math::invertTransform(m_renderData.pMonitor->m_transform)); + Hyprutils::Math::eTransform TRANSFORM = tex->m_transform; + + if (m_monitorTransformEnabled) + TRANSFORM = Math::composeTransform(MONITOR_INVERTED, TRANSFORM); Mat3x3 matrix = m_renderData.monitorProjection.projectBox(newBox, TRANSFORM, newBox.rot); Mat3x3 glMatrix = m_renderData.projection.copy().multiply(matrix); -- cgit v1.2.3