deco-positioner: include sticky in sent geometry

This commit is contained in:
Vaxry 2023-12-11 16:46:20 +00:00
parent 0fdf909b19
commit 8191e635a3

View file

@ -227,28 +227,28 @@ void CDecorationPositioner::onWindowUpdate(CWindow* pWindow) {
stickyOffsetYT += desiredSize; stickyOffsetYT += desiredSize;
stickyOffsetYB += desiredSize; stickyOffsetYB += desiredSize;
} else if (LEFT) { } else if (LEFT) {
pos = wb.pos() - EDGEPOINT - Vector2D{stickyOffsetXL, 0}; pos = wb.pos() - EDGEPOINT - Vector2D{stickyOffsetXL, -stickyOffsetYT};
pos.x -= desiredSize; pos.x -= desiredSize;
size = {desiredSize, wb.size().y}; size = {desiredSize, wb.size().y + stickyOffsetYB + stickyOffsetYT};
if (SOLID) if (SOLID)
stickyOffsetXL += desiredSize; stickyOffsetXL += desiredSize;
} else if (RIGHT) { } else if (RIGHT) {
pos = wb.pos() + Vector2D{wb.size().x, 0} - EDGEPOINT + Vector2D{stickyOffsetXR, 0}; pos = wb.pos() + Vector2D{wb.size().x, 0} - EDGEPOINT + Vector2D{stickyOffsetXR, -stickyOffsetYT};
size = {desiredSize, wb.size().y}; size = {desiredSize, wb.size().y + stickyOffsetYB + stickyOffsetYT};
if (SOLID) if (SOLID)
stickyOffsetXR += desiredSize; stickyOffsetXR += desiredSize;
} else if (TOP) { } else if (TOP) {
pos = wb.pos() - EDGEPOINT - Vector2D{0, stickyOffsetYT}; pos = wb.pos() - EDGEPOINT - Vector2D{stickyOffsetXL, stickyOffsetYT};
pos.y -= desiredSize; pos.y -= desiredSize;
size = {wb.size().x, desiredSize}; size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, desiredSize};
if (SOLID) if (SOLID)
stickyOffsetYT += desiredSize; stickyOffsetYT += desiredSize;
} else { } else {
pos = wb.pos() + Vector2D{0, wb.size().y} - EDGEPOINT - Vector2D{0, stickyOffsetYB}; pos = wb.pos() + Vector2D{0, wb.size().y} - EDGEPOINT - Vector2D{stickyOffsetXL, stickyOffsetYB};
size = {wb.size().x, desiredSize}; size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, desiredSize};
if (SOLID) if (SOLID)
stickyOffsetYB += desiredSize; stickyOffsetYB += desiredSize;