Hi;
On 8/30/08, Stuart Brorson <[EMAIL PROTECTED]> wrote:
> I would like to ask you to again grab the lastest gerbv out of CVS,
> build it, and give it a test on your favorite Gerber files.
I'm awfully sorry; I found that the function dealing with overflows in X11 line
drawing routines in my recent patch does not always work correctly.
It could be fixed as shown in the attached file; please apply it
or let me know when you have time to do it; I'll rebase it against
then-current CVS.
Regards,
Ineiev
Index: src/render.c
===================================================================
RCS file: /cvsroot/gerbv/gerbv/src/render.c,v
retrieving revision 1.67
diff -U3 -r1.67 render.c
--- src/render.c 30 Aug 2008 01:50:40 -0000 1.67
+++ src/render.c 2 Sep 2008 05:03:09 -0000
@@ -321,24 +321,33 @@
if (fabs (*start_x) < max_coord && fabs (*start_y) < max_coord)
return;
- dx = last_x - *start_x;
- dy = last_y - *start_y;
- if (*start_x < -max_coord && last_x > -max_coord && fabs (dx) > 0.1) {
+
+ dx = last_x - *start_x;
+ dy = last_y - *start_y;
+
+ if (*start_x < -max_coord) {
*start_x = -max_coord;
- *start_y = last_y - (last_x + max_coord)/dx * dy;
+ if (last_x > -max_coord && fabs (dx) > 0.1)
+ *start_y = last_y - (last_x + max_coord) / dx * dy;
}
- if (*start_x > max_coord && last_x < max_coord && fabs (dx) > 0.1) {
+ if (*start_x > max_coord) {
*start_x = max_coord;
- *start_y = last_y - (last_x - max_coord) / dx * dy;
+ if (last_x < max_coord && fabs (dx) > 0.1)
+ *start_y = last_y - (last_x - max_coord) / dx * dy;
}
- if (*start_y < -max_coord && last_y > -max_coord && fabs (dy) > 0.1) {
+ dx = last_x - *start_x;
+ dy = last_y - *start_y;
+
+ if (*start_y < -max_coord) {
*start_y = -max_coord;
- *start_x = last_x - (last_y + max_coord) / dy * dx;
+ if (last_y > -max_coord && fabs (dy) > 0.1)
+ *start_x = last_x - (last_y + max_coord) / dy * dx;
}
- if (*start_y > max_coord && last_y < max_coord && fabs (dy) > 0.1) {
+ if (*start_y > max_coord) {
*start_y = max_coord;
- *start_x = last_x - (last_y - max_coord) / dy * dx;
+ if (last_y < max_coord && fabs (dy) > 0.1)
+ *start_x = last_x - (last_y - max_coord) / dy * dx;
}
}
_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev