QRect::right() + 1 == QRect::x() + QRect::width()

Also to catch inner split for sure the calculation needs to be accurate.

BUG: 279774
REVIEW: 102292
(cherry picked from commit 561dac0ae1bd158563e4aa6d0f25268fbc5a97af)
This commit is contained in:
Thomas Lübking 2011-08-10 23:54:28 +02:00
parent e35d0e4aad
commit 8b75f4b321

View file

@ -3074,13 +3074,13 @@ QRect Client::electricBorderMaximizeGeometry(QPoint pos, int desktop)
QRect ret = workspace()->clientArea(MaximizeArea, pos, desktop);
if (electricMode & QuickTileLeft)
ret.setRight(ret.left()+ret.width()/2);
ret.setRight(ret.left()+ret.width()/2 - 1);
else if (electricMode & QuickTileRight)
ret.setLeft(ret.right()-ret.width()/2);
ret.setLeft(ret.right()-(ret.width()-ret.width()/2) + 1);
if (electricMode & QuickTileTop)
ret.setBottom(ret.top()+ret.height()/2);
ret.setBottom(ret.top()+ret.height()/2 - 1);
else if (electricMode & QuickTileBottom)
ret.setTop(ret.bottom()-ret.height()/2);
ret.setTop(ret.bottom()-(ret.height()-ret.height()/2) + 1);
return ret;
}