Round values, don't just truncate.

svn path=/branches/work/kwin_composite/; revision=656976
remotes/origin/Plasma/5.0
Luboš Luňák 19 years ago
parent 98a7c3da6a
commit 56e5618f0e
  1. 10
      effects/desktopgrid.cpp

@ -10,6 +10,8 @@ License. See the file "COPYING" for the exact licensing terms.
#include "desktopgrid.h"
#include <math.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <klocale.h>
@ -276,10 +278,10 @@ QRect DesktopGridEffect::desktopRect( int desktop, bool scaled ) const
if( !scaled )
return rect;
QRect current = desktopRect( effects->currentDesktop(), false );
rect = QRect( int( interpolate( rect.x() - current.x(), rect.x() / float( x ), progress )),
int( interpolate( rect.y() - current.y(), rect.y() / float( y ), progress )),
int( interpolate( rect.width(), displayWidth() / float( x ), progress )),
int( interpolate( rect.height(), displayHeight() / float( y ), progress )));
rect = QRect( lround( interpolate( rect.x() - current.x(), rect.x() / float( x ), progress )),
lround( interpolate( rect.y() - current.y(), rect.y() / float( y ), progress )),
lround( interpolate( rect.width(), displayWidth() / float( x ), progress )),
lround( interpolate( rect.height(), displayHeight() / float( y ), progress )));
return rect;
}

Loading…
Cancel
Save