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) {
|
if (projSize != Vector2D{} && fixMisalignedFSV1) {
|
||||||
// instead of nearest_neighbor (we will repeat / skip)
|
// instead of nearest_neighbor (we will repeat / skip)
|
||||||
// just cut off / expand surface
|
// just cut off / expand surface
|
||||||
const Vector2D PIXELASUV = Vector2D{1, 1} / pSurface->m_current.bufferSize;
|
const Vector2D PIXELASUV = Vector2D{1, 1} / pSurface->m_current.bufferSize;
|
||||||
const Vector2D MISALIGNMENT = pSurface->m_current.bufferSize - projSize;
|
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{})
|
if (MISALIGNMENT != Vector2D{})
|
||||||
uvBR -= MISALIGNMENT * PIXELASUV;
|
uvBR -= MISALIGNMENT * PIXELASUV;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue