Avoid divide by zero.

svn path=/trunk/KDE/kdebase/workspace/; revision=726668
This commit is contained in:
Luboš Luňák 2007-10-18 14:24:46 +00:00
parent 61fa445581
commit d2e8675051

View file

@ -403,8 +403,16 @@ 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;
// Compute starting point for this new move (given current and end positions) if( progress <= 0 )
slide_start_pos = rect.topLeft() - diffPos * 1 / ( 1 - progress ); {
// Compute starting point for this new move (given current and end positions)
slide_start_pos = rect.topLeft() - diffPos * 1 / ( 1 - progress );
}
else
{ // at the end, stop
slide = false;
progress = 0;
}
} }
else else
{ {