[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (9c591b7f752d6c149aafd97d364f82b08f74eee5)



The branch, master has been updated
       via  9c591b7f752d6c149aafd97d364f82b08f74eee5 (commit)
       via  25b839354351c4ac97ae887eaa6f9d3456c96fba (commit)
       via  494d9be6ef390cefcc00f0ce0116b30a47b58ab0 (commit)
      from  2473e26c7d9581753a28f1f55a4a4b7ff109a3f2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/gcode/gcode.c |    4 ++--
 src/hid/png/png.c     |   17 ++++++++++-------
 src/set.c             |    1 +
 3 files changed, 13 insertions(+), 9 deletions(-)


=================
 Commit Messages
=================

commit 9c591b7f752d6c149aafd97d364f82b08f74eee5
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Add missing pcb-printf.h
    
    set.c was calling pcb_g_strdup_printf() without #including pcb-printf.h,
    resulting in a missing prototype warning.

:100644 100644 5712bca... 7c637c1... M	src/set.c

commit 25b839354351c4ac97ae887eaa6f9d3456c96fba
Author: Dima Kogan <dima@xxxxxxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    png hid: fixed some instances of an 'int' being used instead of Coord.
    
    After the unit switch, some cases where an int has sufficed previously no longer
    work. An example is png output of tilted, square pads. Before this patch those
    pads do not get drawn correctly; their size is completely wrong.

:100644 100644 f00d407... ff8931a... M	src/hid/png/png.c

commit 494d9be6ef390cefcc00f0ce0116b30a47b58ab0
Author: Dima Kogan <dima@xxxxxxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    g-code hid: converted use of hypot() to Distance()

:100644 100644 65fd843... f12f6b6... M	src/hid/gcode/gcode.c

=========
 Changes
=========

commit 9c591b7f752d6c149aafd97d364f82b08f74eee5
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Add missing pcb-printf.h
    
    set.c was calling pcb_g_strdup_printf() without #including pcb-printf.h,
    resulting in a missing prototype warning.

diff --git a/src/set.c b/src/set.c
index 5712bca..7c637c1 100644
--- a/src/set.c
+++ b/src/set.c
@@ -55,6 +55,7 @@
 #include "misc.h"
 #include "set.h"
 #include "undo.h"
+#include "pcb-printf.h"
 
 #ifdef HAVE_LIBDMALLOC
 #include <dmalloc.h>

commit 25b839354351c4ac97ae887eaa6f9d3456c96fba
Author: Dima Kogan <dima@xxxxxxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    png hid: fixed some instances of an 'int' being used instead of Coord.
    
    After the unit switch, some cases where an int has sufficed previously no longer
    work. An example is png output of tilted, square pads. Before this patch those
    pads do not get drawn correctly; their size is completely wrong.

diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index f00d407..ff8931a 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -70,7 +70,7 @@ static int show_solder_side;
 #define SCALE(w)   ((int)((w)/scale + 0.5))
 #define SCALE_X(x) ((int)(((x) - x_shift)/scale))
 #define SCALE_Y(y) ((int)(((show_solder_side ? (PCB->MaxHeight-(y)) : (y)) - y_shift)/scale))
-#define SWAP_IF_SOLDER(a,b) do { int c; if (show_solder_side) { c=a; a=b; b=c; }} while (0)
+#define SWAP_IF_SOLDER(a,b) do { Coord c; if (show_solder_side) { c=a; a=b; b=c; }} while (0)
 
 /* Used to detect non-trivial outlines */
 #define NOT_EDGE_X(x) ((x) != 0 && (x) != PCB->MaxWidth)
@@ -634,8 +634,9 @@ png_do_export (HID_Attr_Val * options)
   int save_ons[MAX_LAYER + 2];
   int i;
   BoxType *bbox;
-  int w, h;
-  int xmax, ymax, dpi;
+  Coord w, h;
+  Coord xmax, ymax;
+  int dpi;
   const char *fmt;
   bool format_error = false;
 
@@ -1493,13 +1494,15 @@ png_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
        * it as a filled polygon.
        */
       int fg = gdImageColorResolve (im, gc->color->r, gc->color->g,
-				    gc->color->b),
-	w = gc->width, dx = x2 - x1, dy = y2 - y1, dwx, dwy;
+				    gc->color->b);
+      Coord w = gc->width;
+      Coord dwx, dwy;
+
       gdPoint p[4];
-      double l = sqrt (dx * dx + dy * dy) * 2;
+      double l = Distance(x1, y1, x2, y2) * 2;
 
       w += 2 * bloat;
-      dwx = -w / l * dy; dwy =  w / l * dx;
+      dwx = -w / l * (y2 - y1); dwy =  w / l * (x2 - x1);
       p[0].x = SCALE_X (x1 + dwx - dwy); p[0].y = SCALE_Y(y1 + dwy + dwx);
       p[1].x = SCALE_X (x1 - dwx - dwy); p[1].y = SCALE_Y(y1 - dwy + dwx);
       p[2].x = SCALE_X (x2 - dwx + dwy); p[2].y = SCALE_Y(y2 - dwy - dwx);

commit 494d9be6ef390cefcc00f0ce0116b30a47b58ab0
Author: Dima Kogan <dima@xxxxxxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    g-code hid: converted use of hypot() to Distance()

diff --git a/src/hid/gcode/gcode.c b/src/hid/gcode/gcode.c
index 65fd843..f12f6b6 100644
--- a/src/hid/gcode/gcode.c
+++ b/src/hid/gcode/gcode.c
@@ -697,8 +697,8 @@ gcode_do_export (HID_Attr_Val * options)
                           fprintf (gcode_f2, "G0 Z%s\n", variable_safeZ);
                         }
                       if (r > 0)
-                        d += hypot( drill->holes[r].x - drill->holes[r - 1].x,
-                                    drill->holes[r].y - drill->holes[r - 1].y );
+                        d += Distance(drill->holes[r - 1].x, drill->holes[r - 1].y,
+                                      drill->holes[r    ].x, drill->holes[r    ].y);
                     }
                   if (gcode_advanced)
                     fprintf (gcode_f2, "M5 M9 M2\n");




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs