mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2025-10-29 11:48:42 +00:00
Hyprscrolling: fix layoutmsg fit visible incorrectly include window at the border (#487)
This commit is contained in:
parent
1cfcc6fe6a
commit
1e3fa62428
@ -329,9 +329,13 @@ bool SWorkspaceData::visible(SP<SColumnData> c) {
|
||||
const auto USABLE = layout->usableAreaFor(workspace->m_monitor.lock());
|
||||
float totalLeft = 0;
|
||||
for (const auto& col : columns) {
|
||||
if (col == c)
|
||||
return (totalLeft >= leftOffset && totalLeft < leftOffset + USABLE.w) ||
|
||||
(totalLeft + col->columnWidth * USABLE.w >= leftOffset && totalLeft + col->columnWidth * USABLE.w < leftOffset + USABLE.w);
|
||||
if (col == c) {
|
||||
const float colLeft = totalLeft;
|
||||
const float colRight = totalLeft + col->columnWidth * USABLE.w;
|
||||
const float viewLeft = leftOffset;
|
||||
const float viewRight = leftOffset + USABLE.w;
|
||||
return colLeft < viewRight && viewLeft < colRight;
|
||||
}
|
||||
|
||||
totalLeft += col->columnWidth * USABLE.w;
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ struct SWorkspaceData {
|
||||
|
||||
PHLWORKSPACEREF workspace;
|
||||
std::vector<SP<SColumnData>> columns;
|
||||
int leftOffset = 0;
|
||||
float leftOffset = 0;
|
||||
|
||||
SP<SColumnData> add();
|
||||
SP<SColumnData> add(int after);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user