fix: magiclamp effect wrong direction.

if the dock is on the top,and the dock is not close together with screen edge.
for example,the dock is 10 pixels taller then sceen edge,the "position" will be "Bottom".
Autually,the dock is on the top of screen.
icc-effect-5.26.4
xinbo wang 2020-11-18 09:34:57 +08:00 committed by David Edmundson
parent fe6c296073
commit 44b2a3f872
1 changed files with 2 additions and 2 deletions

View File

@ -140,13 +140,13 @@ void MagicLampEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Win
QRect panelScreen = effects->clientArea(ScreenArea, panel);
if (panel->width() >= panel->height()) {
// horizontal panel
if (panel->y() == panelScreen.y())
if (panel->y() <= panelScreen.height()/2)
position = Top;
else
position = Bottom;
} else {
// vertical panel
if (panel->x() == panelScreen.x())
if (panel->x() <= panelScreen.width()/2)
position = Left;
else
position = Right;