[Uml-devel] kdesdk/umbrello/umbrello

Jonathan Riddell jr at jriddell.org
Wed Mar 19 12:49:09 UTC 2003


On Wed, 19 Mar 2003, Jonathan Riddell wrote:


Sorry Klas, there was another problem I found with your changes to
linepath so I've reverted to the old version keeping the rint()'s.
Hopefully you can work out what was wrong.

Jonathan

> CVS commit by jriddell:
>
> reverted linepath.cpp to revision 1.4 with rounding rint()
> This version caused a freeze on creating a diamond headed association (composition etc)
>
>
>   M +4 -7      linepath.cpp   1.8
>
>
> --- kdesdk/umbrello/umbrello/linepath.cpp  #1.7:1.8
> @@ -8,5 +8,5 @@
>   ***************************************************************************/
>
> -#include <cmath>
> +#include <math.h>
>
>  #include <kdebug.h>
> @@ -358,7 +358,4 @@ void LinePath::calculateHead() {
>          int xb = getPoint(size -1).x();
>          int yb = getPoint(size -1).y();
> -        double deltaX = xb - xa;
> -        double deltaY = yb - ya;
> -        double hypotenuse = sqrt(deltaX*deltaX + deltaY*deltaY); // the length
>          int halfLength = 10;
>          double arrowAngle = 0.5 * atan(sqrt(3.0) / 3.0);
> @@ -368,8 +365,8 @@ void LinePath::calculateHead() {
>                  halfLength += 3;        // longer
>          }
> -        double slope = atan2(deltaY, deltaX);   //slope of line
> -        double cosx = halfLength * deltaX/hypotenuse;
> +        double slope = atan2(double(yb - ya), double(xb - xa)); //slope of line
> +        double cosx = halfLength * cos(slope);
>
> -        double siny = halfLength * deltaY/hypotenuse;
> +        double siny = halfLength * sin(slope);
>          double arrowSlope = slope + arrowAngle;
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Does your code think in ink?
> You could win a Tablet PC. Get a free Tablet PC hat just for playing.
> What are you waiting for?
> http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
> _______________________________________________
> Uml-devel mailing list
> umbrello-devel at kde.org
> https://mail.kde.org/mailman/listinfo/umbrello-devel
>

________________________________________________________
4/4 Geddes Court    |  jr at jriddell.org
Stirling University |  http://www.jriddell.org
FK9 4LR, Scotland   |  07941 938912
 Umbrello UML Modeller: http://uml.sf.net






More information about the umbrello-devel mailing list