mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 05:10:20 +01:00
renderer: fix fractional scale artifacts (#12287)
This commit is contained in:
parent
0770494ddf
commit
7910bc42af
1 changed files with 6 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue