From f5f99c67007e5a7e48480e2f3551e200aea78842 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 28 Aug 2022 14:32:06 +0200 Subject: [PATCH] reset uv on invalid buffer source box --- src/render/Renderer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index a96451b3..82c760be 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -420,6 +420,11 @@ void CHyprRenderer::calculateUVForWindowSurface(CWindow* pWindow, wlr_surface* p uvTL = Vector2D(bufferSource.x / surfaceSize.x, bufferSource.y / surfaceSize.y); uvBR = Vector2D((bufferSource.x + bufferSource.width) / surfaceSize.x, (bufferSource.y + bufferSource.height) / surfaceSize.y); + if (uvBR.x < 0.01f || uvBR.y < 0.01f) { + uvTL = Vector2D(); + uvBR = Vector2D(1,1); + } + // TODO: (example: chromium) this still has a tiny "bump" at the end. if (main) { uvTL = uvTL + (Vector2D((double)geom.x / ((double)pWindow->m_uSurface.xdg->surface->current.width), (double)geom.y / ((double)pWindow->m_uSurface.xdg->surface->current.height)) * (((uvBR.x - uvTL.x) * surfaceSize.x) / surfaceSize.x));