[Kst] branches/kst/1.3/kst/src/libkstapp

Nicolas Brisset nicolas.brisset at eurocopter.com
Wed Oct 11 09:21:29 CEST 2006


SVN commit 594403 by brisset:

Make it more portable (at least, it compiles on Linux and Solaris 8 like this while round seems to be lacking under Solaris)


 M  +2 -2      kstgfxmousehandlerutils.cpp  


--- branches/kst/1.3/kst/src/libkstapp/kstgfxmousehandlerutils.cpp #594402:594403
@@ -186,8 +186,8 @@
     } else if (mouseDisplacement.y() == 0) { // horizontal line.
       npos = findNearestPtOnLine(mouseOrigin, mouseOrigin + QPoint(1,0), pos, bounds);
     } else { // 45deg or vertical or horizontal.
-      int dx = int(round(2.0*mouseDisplacement.x()/abs(mouseDisplacement.y())));
-      int dy = int(round(2.0*mouseDisplacement.y()/abs(mouseDisplacement.x())));
+      int dx = int(rint(2.0*mouseDisplacement.x()/abs(mouseDisplacement.y())));
+      int dy = int(rint(2.0*mouseDisplacement.y()/abs(mouseDisplacement.x())));
 
       if (dx != 0) {
         dx /= abs(dx);


More information about the Kst mailing list