Lines 1-33
Link Here
|
1 |
--- linkablemapobj.cpp.orig Fri Sep 24 16:50:15 2004 |
1 |
--- linkablemapobj.cpp.orig Tue Jan 4 10:49:50 2005 |
2 |
+++ linkablemapobj.cpp Thu Oct 21 17:22:44 2004 |
2 |
+++ linkablemapobj.cpp Sat Jan 15 12:41:45 2005 |
3 |
@@ -6,6 +6,12 @@ |
3 |
@@ -1,4 +1,4 @@ |
|
|
4 |
-//#include <math.h> |
5 |
+#include <math.h> |
4 |
|
6 |
|
5 |
#include "version.h" |
7 |
#include "linkablemapobj.h" |
|
|
8 |
#include "branchobj.h" |
9 |
@@ -456,10 +456,10 @@ |
10 |
double vy=p2y - p1y; |
6 |
|
11 |
|
7 |
+#if !defined(HAVE_LRINTF) |
12 |
// Draw the horizontal line below heading (from ChildPos to ParPos) |
8 |
+static inline long int lrint(double x) |
13 |
- bottomline->setPoints (lrint(childPos.x()), |
9 |
+{ |
14 |
- lrint(childPos.y()), |
10 |
+ return (long)(rint(x)); |
15 |
- lrint(p1x), |
11 |
+} |
16 |
- lrint(p1y) ); |
12 |
+#endif |
17 |
+ bottomline->setPoints ((long)rint(childPos.x()), |
13 |
|
18 |
+ (long)rint(childPos.y()), |
14 |
///////////////////////////////////////////////////////////////// |
19 |
+ (long)rint(p1x), |
15 |
// LinkableMapObj |
20 |
+ (long)rint(p1y) ); |
16 |
@@ -400,7 +406,7 @@ |
|
|
17 |
lrint(p1y) ); |
18 |
|
21 |
|
19 |
double a; // angle |
22 |
double a; // angle |
20 |
- if (abs(vx)<0.000001) |
23 |
if (vx > -0.000001 && vx < 0.000001) |
21 |
+ if (fabs(vx)<0.000001) |
24 |
@@ -467,7 +467,7 @@ |
22 |
a=M_PI_2; |
|
|
23 |
else |
25 |
else |
24 |
a=atan( vy / vx ); |
26 |
a=atan( vy / vx ); |
25 |
@@ -611,7 +617,7 @@ |
27 |
// "turning point" for drawing polygonal links |
26 |
double pny; |
28 |
- QPoint tp (-lrint(sin (a)*thickness_start), lrint(cos (a)*thickness_start)); |
27 |
double m; |
29 |
+ QPoint tp (-(long)rint(sin (a)*thickness_start), (long)rint(cos (a)*thickness_start)); |
|
|
30 |
|
31 |
QCanvasLine *cl; |
28 |
|
32 |
|
29 |
- if (abs(vx) <0.0001) |
33 |
@@ -477,10 +477,10 @@ |
30 |
+ if (fabs(vx) <0.0001) |
34 |
switch (style) |
31 |
m=0; |
35 |
{ |
32 |
else |
36 |
case StyleLine: |
|
|
37 |
- l->setPoints( lrint (parPos.x()), |
38 |
- lrint(parPos.y()), |
39 |
- lrint(p2x), |
40 |
- lrint(p2y) ); |
41 |
+ l->setPoints( (long)rint (parPos.x()), |
42 |
+ (long)rint(parPos.y()), |
43 |
+ (long)rint(p2x), |
44 |
+ (long)rint(p2y) ); |
45 |
break; |
46 |
case StyleParabel: |
47 |
parabel (pa0, p1x,p1y,p2x,p2y); |
48 |
@@ -492,15 +492,15 @@ |
49 |
} |
50 |
break; |
51 |
case StylePolyLine: |
52 |
- pa0[0]=QPoint (lrint(p2x+tp.x()), lrint(p2y+tp.y())); |
53 |
- pa0[1]=QPoint (lrint(p2x-tp.x()), lrint(p2y-tp.y())); |
54 |
- pa0[2]=QPoint (lrint (parPos.x()), lrint(parPos.y()) ); |
55 |
+ pa0[0]=QPoint ((long)rint(p2x+tp.x()), (long)rint(p2y+tp.y())); |
56 |
+ pa0[1]=QPoint ((long)rint(p2x-tp.x()), (long)rint(p2y-tp.y())); |
57 |
+ pa0[2]=QPoint ((long)rint (parPos.x()), (long)rint(parPos.y()) ); |
58 |
p->setPoints (pa0); |
59 |
// here too, draw line to avoid missing pixels |
60 |
- l->setPoints( lrint (parPos.x()), |
61 |
- lrint(parPos.y()), |
62 |
- lrint(p2x), |
63 |
- lrint(p2y) ); |
64 |
+ l->setPoints( (long)rint (parPos.x()), |
65 |
+ (long)rint(parPos.y()), |
66 |
+ (long)rint(p2x), |
67 |
+ (long)rint(p2y) ); |
68 |
break; |
69 |
case StylePolyParabel: |
70 |
parabel (pa1, p1x,p1y,p2x+tp.x(),p2y+tp.y()); |
71 |
@@ -680,12 +680,12 @@ |
33 |
m=(vy / (vx*vx)); |
72 |
m=(vy / (vx*vx)); |
|
|
73 |
dx=vx/(arcsegs); |
74 |
int i; |
75 |
- ya.setPoint (0,QPoint (lrint(p1x),lrint(p1y))); |
76 |
+ ya.setPoint (0,QPoint ((long)rint(p1x),(long)rint(p1y))); |
77 |
for (i=1;i<=arcsegs;i++) |
78 |
{ |
79 |
pnx=p1x+dx; |
80 |
pny=m*(pnx-parPos.x())*(pnx-parPos.x())+parPos.y(); |
81 |
- ya.setPoint (i,QPoint (lrint(pnx),lrint(pny))); |
82 |
+ ya.setPoint (i,QPoint ((long)rint(pnx),(long)rint(pny))); |
83 |
p1x=pnx; |
84 |
p1y=pny; |
85 |
} |