From 0d3ccec4856bf1fde6486d4c3696ed3064d43e3f Mon Sep 17 00:00:00 2001 From: dawsers Date: Tue, 25 Feb 2025 18:53:14 +0100 Subject: [PATCH] dispatchers: scaleactive fix for some popup locations --- src/desktop/Popup.cpp | 6 +++++- src/render/pass/SurfacePassElement.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/desktop/Popup.cpp b/src/desktop/Popup.cpp index ab392d0f6dc..074a366e5ef 100644 --- a/src/desktop/Popup.cpp +++ b/src/desktop/Popup.cpp @@ -226,7 +226,11 @@ void CPopup::reposition() { if (!PMONITOR) return; - CBox box = {PMONITOR->vecPosition.x, PMONITOR->vecPosition.y, PMONITOR->vecSize.x, PMONITOR->vecSize.y}; + CBox box = {PMONITOR->vecPosition.x, PMONITOR->vecPosition.y, PMONITOR->vecSize.x, PMONITOR->vecSize.y}; + const auto scale = getContentScale(); + box.w = COORDS.x + (box.w - COORDS.x) * scale; + box.h = COORDS.y + (box.h - COORDS.y) * scale; + m_pResource->applyPositioning(box, COORDS); } diff --git a/src/render/pass/SurfacePassElement.cpp b/src/render/pass/SurfacePassElement.cpp index f97676bc008..a19a2a814e0 100644 --- a/src/render/pass/SurfacePassElement.cpp +++ b/src/render/pass/SurfacePassElement.cpp @@ -179,10 +179,10 @@ CBox CSurfacePassElement::getTexBox() { } if (data.squishOversized) { - if (data.localPos.x + windowBox.width > data.w) - windowBox.width = data.w - data.localPos.x; - if (data.localPos.y + windowBox.height > data.h) - windowBox.height = data.h - data.localPos.y; + if (data.localPos.x / data.contentScale + windowBox.width > data.w) + windowBox.width = data.w - data.localPos.x / data.contentScale; + if (data.localPos.y / data.contentScale + windowBox.height > data.h) + windowBox.height = data.h - data.localPos.y / data.contentScale; } return windowBox;