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

gEDA-cvs: pcb.git: branch: master updated (5f3ed7cc41b8033c85f9ac6e2f664f1d0749e13e)



The branch, master has been updated
       via  5f3ed7cc41b8033c85f9ac6e2f664f1d0749e13e (commit)
      from  23ce99f3dc445e611fd501074c7c9514aad800d7 (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/png/png.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)


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

commit 5f3ed7cc41b8033c85f9ac6e2f664f1d0749e13e
Author: Newell Jensen <pillar2012@xxxxxxxxx>
Commit: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>

    hid/png: draw zero-length arcs properly on export
    
    Closes-bug: lp-699314
    Reviewed-by: Patrick Bernaud <patrickb@xxxxxxxx>
    Reviewed-by: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>

:100644 100644 06d4296... fe7046e... M	src/hid/png/png.c

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

commit 5f3ed7cc41b8033c85f9ac6e2f664f1d0749e13e
Author: Newell Jensen <pillar2012@xxxxxxxxx>
Commit: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>

    hid/png: draw zero-length arcs properly on export
    
    Closes-bug: lp-699314
    Reviewed-by: Patrick Bernaud <patrickb@xxxxxxxx>
    Reviewed-by: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>

diff --git a/src/hid/png/png.c b/src/hid/png/png.c
index 06d4296..fe7046e 100644
--- a/src/hid/png/png.c
+++ b/src/hid/png/png.c
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
+#include <math.h>
 
 #include "global.h"
 #include "data.h"
@@ -1405,6 +1406,20 @@ png_draw_arc (hidGC gc, int cx, int cy, int width, int height,
 {
   int sa, ea;
 
+  /*
+   * zero angle arcs need special handling as gd will output either
+   * nothing at all or a full circle when passed delta angle of 0 or 360.
+   */
+  if (delta_angle == 0) {
+    double r = width;
+    int x = (int) (r * cos (start_angle * M_PI / 180));
+    int y = (int) (r * sin (start_angle * M_PI / 180));
+    x = cx - x;
+    y = cy + y;
+    png_fill_circle (gc, x, y, gc->width / 2);
+    return;
+  }
+
   /* 
    * in gdImageArc, 0 degrees is to the right and +90 degrees is down
    * in pcb, 0 degrees is to the left and +90 degrees is down



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