diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-10-19 02:56:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-19 02:56:55 +0200 |
| commit | ba077d8ff09e38a5b20c5d06d71daab52bbcc36d (patch) | |
| tree | f0d761e4bf4d8596722d7ba0e5d8eb7510ae2864 /src/desktop | |
| parent | 39d62e1487052da2751ec1e36d243e3e92e24f6a (diff) | |
renderer: clean up surface UV size calcs, fix issues (#12070)
Diffstat (limited to 'src/desktop')
| -rw-r--r-- | src/desktop/WLSurface.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/desktop/WLSurface.cpp b/src/desktop/WLSurface.cpp index 1a1bd293..ff6a69de 100644 --- a/src/desktop/WLSurface.cpp +++ b/src/desktop/WLSurface.cpp @@ -117,11 +117,13 @@ CRegion CWLSurface::computeDamage() const { // go from buffer coords in the damage to hl logical - const auto BOX = getSurfaceBoxGlobal(); - const Vector2D SCALE = BOX.has_value() ? BOX->size() / m_resource->m_current.bufferSize : - Vector2D{1.0 / m_resource->m_current.scale, 1.0 / m_resource->m_current.scale /* Wrong... but we can't really do better */}; + const auto BOX = getSurfaceBoxGlobal(); + const auto SURFSIZE = m_resource->m_current.size; + const Vector2D SCALE = SURFSIZE / m_resource->m_current.bufferSize; damage.scale(SCALE); + if (BOX.has_value()) + damage.intersect(CBox{{}, BOX->size()}); if (m_windowOwner) damage.scale(m_windowOwner->m_X11SurfaceScaledBy); // fix xwayland:force_zero_scaling stuff that will be fucked by the above a bit |
