Skip to content

Commit

Permalink
dispatchers: scaleactive fix for some popup locations
Browse files Browse the repository at this point in the history
  • Loading branch information
dawsers committed Feb 25, 2025
1 parent 6ba4e54 commit 0d3ccec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/desktop/Popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
8 changes: 4 additions & 4 deletions src/render/pass/SurfacePassElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0d3ccec

Please sign in to comment.