mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-29 23:45:58 +01:00
renderer: separate oversize uv calcs in dimensions
This commit is contained in:
parent
ba5bc5871f
commit
68935ba9dc
1 changed files with 2 additions and 2 deletions
|
@ -776,11 +776,11 @@ void CHyprRenderer::calculateUVForSurface(CWindow* pWindow, wlr_surface* pSurfac
|
||||||
uvBR = uvBR - Vector2D(1.0 - WPERC * (uvBR.x - uvTL.x), 1.0 - HPERC * (uvBR.y - uvTL.y));
|
uvBR = uvBR - Vector2D(1.0 - WPERC * (uvBR.x - uvTL.x), 1.0 - HPERC * (uvBR.y - uvTL.y));
|
||||||
uvTL = uvTL + TOADDTL;
|
uvTL = uvTL + TOADDTL;
|
||||||
|
|
||||||
if (geom.width > pWindow->m_vRealSize.vec().x || geom.height > pWindow->m_vRealSize.vec().y) {
|
if (geom.width > pWindow->m_vRealSize.vec().x)
|
||||||
uvBR.x = uvBR.x * (pWindow->m_vRealSize.vec().x / geom.width);
|
uvBR.x = uvBR.x * (pWindow->m_vRealSize.vec().x / geom.width);
|
||||||
|
if (geom.height > pWindow->m_vRealSize.vec().y)
|
||||||
uvBR.y = uvBR.y * (pWindow->m_vRealSize.vec().y / geom.height);
|
uvBR.y = uvBR.y * (pWindow->m_vRealSize.vec().y / geom.height);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
g_pHyprOpenGL->m_RenderData.primarySurfaceUVTopLeft = uvTL;
|
g_pHyprOpenGL->m_RenderData.primarySurfaceUVTopLeft = uvTL;
|
||||||
g_pHyprOpenGL->m_RenderData.primarySurfaceUVBottomRight = uvBR;
|
g_pHyprOpenGL->m_RenderData.primarySurfaceUVBottomRight = uvBR;
|
||||||
|
|
Loading…
Reference in a new issue