Avoid divide by zero.
svn path=/trunk/KDE/kdebase/workspace/; revision=726668
This commit is contained in:
parent
61fa445581
commit
d2e8675051
1 changed files with 10 additions and 2 deletions
|
@ -403,9 +403,17 @@ void DesktopGridEffect::slideDesktopChanged( int old )
|
||||||
else // current position is not on current desktop, do full progress
|
else // current position is not on current desktop, do full progress
|
||||||
progress = 0;
|
progress = 0;
|
||||||
diffPos = rect.topLeft() - currentPos;
|
diffPos = rect.topLeft() - currentPos;
|
||||||
|
if( progress <= 0 )
|
||||||
|
{
|
||||||
// Compute starting point for this new move (given current and end positions)
|
// Compute starting point for this new move (given current and end positions)
|
||||||
slide_start_pos = rect.topLeft() - diffPos * 1 / ( 1 - progress );
|
slide_start_pos = rect.topLeft() - diffPos * 1 / ( 1 - progress );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{ // at the end, stop
|
||||||
|
slide = false;
|
||||||
|
progress = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
progress = 0;
|
progress = 0;
|
||||||
|
|
Loading…
Reference in a new issue