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,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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue