summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 9a2410f3..b115bab9 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1134,8 +1134,12 @@ void CHyprRenderer::calculateUVForSurface(PHLWINDOW pWindow, SP<CWLSurfaceResour
if (projSize != Vector2D{} && fixMisalignedFSV1) {
// instead of nearest_neighbor (we will repeat / skip)
// just cut off / expand surface
- const Vector2D PIXELASUV = Vector2D{1, 1} / pSurface->m_current.bufferSize;
- const Vector2D MISALIGNMENT = pSurface->m_current.bufferSize - projSize;
+ const Vector2D PIXELASUV = Vector2D{1, 1} / pSurface->m_current.bufferSize;
+ const auto& BUFFER_SIZE = pSurface->m_current.bufferSize;
+
+ // compute MISALIGN from the adjusted UV coordinates.
+ const Vector2D MISALIGNMENT = (uvBR - uvTL) * BUFFER_SIZE - projSize;
+
if (MISALIGNMENT != Vector2D{})
uvBR -= MISALIGNMENT * PIXELASUV;
} else {