[Uml-devel] kdesdk/umbrello/umbrello
Jonathan Riddell
jri at jriddell.org
Wed Mar 19 07:27:06 UTC 2003
CVS commit by jriddell:
Removed use of round() function, which is only defined in C99 and doesn't
compile with gcc 2.95
M +9 -9 linepath.cpp 1.6
--- kdesdk/umbrello/umbrello/linepath.cpp #1.5:1.6
@@ -8,5 +8,5 @@
***************************************************************************/
-#include <math.h>
+#include <cmath>
#include <kdebug.h>
@@ -375,9 +375,9 @@ void LinePath::calculateHead() {
m_LastPoint = getPoint(size - 1);
- m_ArrowPointA.setX( (int)round(m_LastPoint.x() - halfLength * cos(arrowSlope) ) );
- m_ArrowPointA.setY( (int)round(m_LastPoint.y() - halfLength * sin(arrowSlope)) );
+ m_ArrowPointA.setX( (int)(m_LastPoint.x() - halfLength * cos(arrowSlope)) );
+ m_ArrowPointA.setY( (int)(m_LastPoint.y() - halfLength * sin(arrowSlope)) );
arrowSlope = slope - arrowAngle;
- m_ArrowPointB.setX( (int)round(m_LastPoint.x() - halfLength * cos(arrowSlope)) );
- m_ArrowPointB.setY( (int)round(m_LastPoint.y() - halfLength * sin(arrowSlope)) );
+ m_ArrowPointB.setX( (int)(m_LastPoint.x() - halfLength * cos(arrowSlope)) );
+ m_ArrowPointB.setY( (int)(m_LastPoint.y() - halfLength * sin(arrowSlope)) );
if(xa > xb)
@@ -391,8 +391,8 @@ void LinePath::calculateHead() {
siny = siny > 0 ? siny * -1 : siny;
- m_MidPoint.setX( (int)round(m_LastPoint.x() + cosx) );
- m_MidPoint.setY( (int)round(m_LastPoint.y() + siny) );
- m_FullPoint.setX( (int)round(m_LastPoint.x() + cosx * 2) );
- m_FullPoint.setY( (int)round(m_LastPoint.y() + siny * 2) );
+ m_MidPoint.setX( (int)(m_LastPoint.x() + cosx) );
+ m_MidPoint.setY( (int)(m_LastPoint.y() + siny) );
+ m_FullPoint.setX( (int)(m_LastPoint.x() + cosx * 2) );
+ m_FullPoint.setY( (int)(m_LastPoint.y() + siny * 2) );
m_PointArray.setPoint(0, m_LastPoint);
More information about the umbrello-devel
mailing list