renderer: fix uv sufrace calc with scales < 1 (#12481)

This commit is contained in:
EvilLary 2025-11-30 00:16:49 +03:00 committed by GitHub
parent 574ee71d56
commit f11cf6f1de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1195,7 +1195,7 @@ void CHyprRenderer::calculateUVForSurface(PHLWINDOW pWindow, SP<CWLSurfaceResour
// to let the apps know to NOT add CSD. Also if source is there.
// there is no way to fix this if that's the case
const auto MONITOR_WL_SCALE = std::ceil(pMonitor->m_scale);
const bool SCALE_UNAWARE = MONITOR_WL_SCALE > 1 && (MONITOR_WL_SCALE == pSurface->m_current.scale || !pSurface->m_current.viewport.hasDestination);
const bool SCALE_UNAWARE = pMonitor->m_scale != 1.f && (MONITOR_WL_SCALE == pSurface->m_current.scale || !pSurface->m_current.viewport.hasDestination);
const auto EXPECTED_SIZE = getSurfaceExpectedSize(pWindow, pSurface, pMonitor, main).value_or((projSize * pMonitor->m_scale).round());
const auto RATIO = projSize / EXPECTED_SIZE;