fix cutting geometry on surfaces spilling out

This commit is contained in:
Vaxry 2023-01-22 16:24:51 +01:00
parent fcbfd19393
commit 7d754b7c22

View file

@ -577,7 +577,7 @@ void CHyprRenderer::calculateUVForWindowSurface(CWindow* pWindow, wlr_surface* p
wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, &geom); wlr_xdg_surface_get_geometry(pWindow->m_uSurface.xdg, &geom);
// ignore X and Y, adjust uv // ignore X and Y, adjust uv
if (geom.x != 0 || geom.y != 0) { if (geom.x != 0 || geom.y != 0 || geom.width > pWindow->m_vRealSize.vec().x || geom.height > pWindow->m_vRealSize.vec().y) {
const auto XPERC = (double)geom.x / (double)pSurface->current.width; const auto XPERC = (double)geom.x / (double)pSurface->current.width;
const auto YPERC = (double)geom.y / (double)pSurface->current.height; const auto YPERC = (double)geom.y / (double)pSurface->current.height;
const auto WPERC = (double)(geom.x + geom.width) / (double)pSurface->current.width; const auto WPERC = (double)(geom.x + geom.width) / (double)pSurface->current.width;