hyprscrolling: Fix issue with std:clamp and window size

https://github.com/hyprwm/hyprland-plugins/issues/567
This commit is contained in:
Fabio Kreusch 2026-01-12 15:36:54 -03:00
parent fef398ed5e
commit 0919501bb8

View file

@ -237,7 +237,9 @@ void SWorkspaceData::fitCol(SP<SColumnData> c) {
if (COL != c)
currentLeft += ITEM_WIDTH;
else {
leftOffset = std::clamp((double)leftOffset, currentLeft - USABLE.w + ITEM_WIDTH, currentLeft);
const double minOffset = currentLeft - USABLE.w + ITEM_WIDTH;
const double maxOffset = currentLeft;
leftOffset = std::clamp((double)leftOffset, std::min(minOffset, maxOffset), std::max(minOffset, maxOffset));
return;
}
}