From 56e5618f0e52ae8a176ae8da93dbea2505fca781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Sun, 22 Apr 2007 21:22:05 +0000 Subject: [PATCH] Round values, don't just truncate. svn path=/branches/work/kwin_composite/; revision=656976 --- effects/desktopgrid.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/effects/desktopgrid.cpp b/effects/desktopgrid.cpp index dad2f0ba06..04f07ad324 100644 --- a/effects/desktopgrid.cpp +++ b/effects/desktopgrid.cpp @@ -10,6 +10,8 @@ License. See the file "COPYING" for the exact licensing terms. #include "desktopgrid.h" +#include + #include #include #include @@ -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; }