[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: o_arc.c
User: pcjc2
Date: 07/04/21 06:08:11
Modified: . o_arc.c
Log:
Fix for drawing a dotted arc / circle with angular dot spacing too small to render.
Was a sign error in the alternative codepath for drawing these cases.
Revision Changes Path
1.30 +10 -9 eda/geda/gaf/gschem/src/o_arc.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_arc.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_arc.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- o_arc.c 17 Apr 2007 20:19:17 -0000 1.29
+++ o_arc.c 21 Apr 2007 10:08:10 -0000 1.30
@@ -308,13 +308,14 @@
angle1 = angle1 + angle2;
angle2 = -angle2;
}
- da = (int) ((((double) space) * 180) / (M_PI * ((double) radius)));
- /* If da or db too small for arc to be displayed as dotted,
+ da = space * 180 / (M_PI * radius);
+
+ /* If da is too small for arc to be displayed as dotted,
draw a solid arc */
if(da <= 0) {
gdk_draw_arc(w, gc, FALSE,
- x + radius, y + radius, 2 * radius, 2 * radius,
+ x - radius, y - radius, 2 * radius, 2 * radius,
angle1 * 64, angle2 * 64);
return;
}
@@ -405,8 +406,8 @@
angle1 = angle1 + angle2;
angle2 = -angle2;
}
- da = (int) ((length * 180) / (M_PI * ((double) radius)));
- db = (int) ((space * 180) / (M_PI * ((double) radius)));
+ da = length * 180 / (M_PI * radius);
+ db = space * 180 / (M_PI * radius);
/* If da or db too small for arc to be displayed as dotted,
draw a solid arc */
@@ -512,8 +513,8 @@
angle1 = angle1 + angle2;
angle2 = -angle2;
}
- da = (int) ((length * 180) / (M_PI * ((double) radius)));
- db = (int) ((space * 180) / (M_PI * ((double) radius)));
+ da = length * 180 / (M_PI * radius);
+ db = space * 180 / (M_PI * radius);
/* If da or db too small to be displayed, draw an arc */
if((da <= 0) || (db <= 0)) {
@@ -665,8 +666,8 @@
angle1 = angle1 + angle2;
angle2 = -angle2;
}
- da = (int) ((length * 180) / (M_PI * ((double) radius)));
- db = (int) ((space * 180) / (M_PI * ((double) radius)));
+ da = length * 180 / (M_PI * radius);
+ db = space * 180 / (M_PI * radius);
/* If da or db too small for arc to be displayed as dotted,
draw a solid arc */
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs