Fix off-by-one error in window corner snapping when resizing
svn path=/trunk/KDE/kdebase/workspace/; revision=840691
This commit is contained in:
parent
cbe5eaef30
commit
637f1dacb7
1 changed files with 8 additions and 8 deletions
16
geometry.cpp
16
geometry.cpp
|
@ -620,29 +620,29 @@ QRect Workspace::adjustClientSize( Client* c, QRect moveResizeGeom, int mode )
|
||||||
#define SNAP_WINDOW_C_TOP if ( (sOWO?(newcy<ly):true) \
|
#define SNAP_WINDOW_C_TOP if ( (sOWO?(newcy<ly):true) \
|
||||||
&& (newcx == lrx || newrx == lx) \
|
&& (newcx == lrx || newrx == lx) \
|
||||||
&& qAbs(ly-newcy) < deltaY ) { \
|
&& qAbs(ly-newcy) < deltaY ) { \
|
||||||
deltaY = qAbs( ly - newcy ); \
|
deltaY = qAbs( ly - newcy + 1 ); \
|
||||||
newcy=ly; \
|
newcy = ly + 1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SNAP_WINDOW_C_BOTTOM if ( (sOWO?(newry>lry):true) \
|
#define SNAP_WINDOW_C_BOTTOM if ( (sOWO?(newry>lry):true) \
|
||||||
&& (newcx == lrx || newrx == lx) \
|
&& (newcx == lrx || newrx == lx) \
|
||||||
&& qAbs(lry-newry) < deltaY ) { \
|
&& qAbs(lry-newry) < deltaY ) { \
|
||||||
deltaY = qAbs( lry - newry ); \
|
deltaY = qAbs( lry - newry - 1 ); \
|
||||||
newry=lry; \
|
newry = lry - 1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SNAP_WINDOW_C_LEFT if ( (sOWO?(newcx<lx):true) \
|
#define SNAP_WINDOW_C_LEFT if ( (sOWO?(newcx<lx):true) \
|
||||||
&& (newcy == lry || newry == ly) \
|
&& (newcy == lry || newry == ly) \
|
||||||
&& qAbs(lx-newcx) < deltaX ) { \
|
&& qAbs(lx-newcx) < deltaX ) { \
|
||||||
deltaX = qAbs( lx - newcx ); \
|
deltaX = qAbs( lx - newcx + 1 ); \
|
||||||
newcx=lx; \
|
newcx = lx + 1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SNAP_WINDOW_C_RIGHT if ( (sOWO?(newrx>lrx):true) \
|
#define SNAP_WINDOW_C_RIGHT if ( (sOWO?(newrx>lrx):true) \
|
||||||
&& (newcy == lry || newry == ly) \
|
&& (newcy == lry || newry == ly) \
|
||||||
&& qAbs(lrx-newrx) < deltaX ) { \
|
&& qAbs(lrx-newrx) < deltaX ) { \
|
||||||
deltaX = qAbs( lrx - newrx ); \
|
deltaX = qAbs( lrx - newrx - 1 ); \
|
||||||
newrx=lrx; \
|
newrx = lrx - 1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ( mode )
|
switch ( mode )
|
||||||
|
|
Loading…
Reference in a new issue