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

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-135-ga50629e)



The branch, master has been updated
       via  a50629e77c16758e44d857a929abe98437ab4583 (commit)
       via  ba15c06da1ec82e3ff063e211def6d8a983f1bde (commit)
       via  975fc0827bf61e3e88ec374d3440b0887c2d5ef2 (commit)
       via  7a6b1a22fec9785f503c46d24406046feb04d87f (commit)
       via  d6c486a1fac1abce71b8805285fef664e252af98 (commit)
      from  30b150c00aa04b05dd6e85cd5f336f379b4def1b (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
=========

 gschem/src/o_arc.c        |   15 ++++++++++-----
 gschem/src/o_circle.c     |    2 +-
 gschem/src/o_grips.c      |   12 ++++++------
 libgeda/src/o_arc_basic.c |   13 +++++++++----
 4 files changed, 26 insertions(+), 16 deletions(-)


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

commit a50629e77c16758e44d857a929abe98437ab4583
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 18:56:51 2009 +0000

    gschem: Drawing circle radius line with a non translated cairo matrix.
    
    Hinting for drawing the circle may have caused us to translate a non-
    integer amount, which would cause the radius line to be shown blurred.

:100644 100644 13668d9... 05171bb... M	gschem/src/o_circle.c

commit ba15c06da1ec82e3ff063e211def6d8a983f1bde
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 18:44:00 2009 +0000

    libgeda: Fix hit-detection of arcs with negative end_angle

:100644 100644 3536848... 6a6e11b... M	libgeda/src/o_arc_basic.c

commit 975fc0827bf61e3e88ec374d3440b0887c2d5ef2
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 18:43:27 2009 +0000

    libgeda: Fix calculation of arc bounds for arc with 360 degree sweep

:100644 100644 37b7512... 3536848... M	libgeda/src/o_arc_basic.c

commit 7a6b1a22fec9785f503c46d24406046feb04d87f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 18:43:26 2009 +0000

    gschem: Fix rubberbanding of arcs with negative end_angles
    
    Such arcs are typically generated by mirroring. If the arc being
    rubberbanded previously had a negative sweep, keep that the case
    in the rubberbanded version.
    
    Also fixes a bug where we're rubberband to give a zero degree sweep
    arc rather than a 360 degree one.

:100644 100644 a9eba03... ba2dedf... M	gschem/src/o_arc.c

commit d6c486a1fac1abce71b8805285fef664e252af98
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 17:48:18 2009 +0000

    gschem: Alter order of grip search when rubberbanding arcs
    
    If you inadvertently land the grip which adjusts the sweep
    of the arc on top of the one which sets its offset angle, it is
    impossible to do anything but rotate the whole arc segment.

:100644 100644 8ae6fe6... ec28bb4... M	gschem/src/o_grips.c

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

commit a50629e77c16758e44d857a929abe98437ab4583
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 18:56:51 2009 +0000

    gschem: Drawing circle radius line with a non translated cairo matrix.
    
    Hinting for drawing the circle may have caused us to translate a non-
    integer amount, which would cause the radius line to be shown blurred.

diff --git a/gschem/src/o_circle.c b/gschem/src/o_circle.c
index 13668d9..05171bb 100644
--- a/gschem/src/o_circle.c
+++ b/gschem/src/o_circle.c
@@ -615,9 +615,9 @@ void o_circle_draw_rubber (GSCHEM_TOPLEVEL *w_current)
   cairo_scale (w_current->cr, (double)(sx2 - sx1 + 1) /
                               (double)(sy2 - sy1 + 1), 1.);
 
-  gschem_cairo_line (w_current->cr, END_NONE, 1, 0., 0., radius, 0.);
   gschem_cairo_arc (w_current->cr, 1, 0., 0., radius, 0., 360);
   cairo_identity_matrix (w_current->cr);
+  gschem_cairo_line (w_current->cr, END_NONE, 1, cx, cy, cx + radius, cy);
 
   gschem_cairo_set_source_color (w_current->cr,
                                  x_color_lookup_dark (SELECT_COLOR));

commit ba15c06da1ec82e3ff063e211def6d8a983f1bde
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 18:44:00 2009 +0000

    libgeda: Fix hit-detection of arcs with negative end_angle

diff --git a/libgeda/src/o_arc_basic.c b/libgeda/src/o_arc_basic.c
index 3536848..6a6e11b 100644
--- a/libgeda/src/o_arc_basic.c
+++ b/libgeda/src/o_arc_basic.c
@@ -1315,8 +1315,13 @@ gboolean o_arc_within_sweep(ARC *arc, gint x, gint y)
 
   angle = 180 * atan2(dy, dx) / G_PI;
 
-  a0 = (gdouble) arc->start_angle;
-  a1 = ((gdouble) arc->end_angle) + a0;
+  if (arc->end_angle > 0) {
+    a0 = arc->start_angle;
+    a1 = arc->start_angle + arc->end_angle;
+  } else {
+    a0 = arc->start_angle + arc->end_angle + 360;
+    a1 = arc->start_angle + 360;
+  }
 
   while (angle < a0) {
     angle+=360;

commit 975fc0827bf61e3e88ec374d3440b0887c2d5ef2
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 18:43:27 2009 +0000

    libgeda: Fix calculation of arc bounds for arc with 360 degree sweep

diff --git a/libgeda/src/o_arc_basic.c b/libgeda/src/o_arc_basic.c
index 37b7512..3536848 100644
--- a/libgeda/src/o_arc_basic.c
+++ b/libgeda/src/o_arc_basic.c
@@ -534,8 +534,8 @@ void world_get_arc_bounds(TOPLEVEL *toplevel, OBJECT *object, int *left,
   halfwidth = object->line_width / 2;
 
   radius      = object->arc->width / 2;
-  start_angle = object->arc->start_angle % 360;
-  end_angle   = object->arc->end_angle   % 360;
+  start_angle = object->arc->start_angle;
+  end_angle   = object->arc->end_angle;
 
   x1 = object->arc->x;
   y1 = object->arc->y;

commit 7a6b1a22fec9785f503c46d24406046feb04d87f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 18:43:26 2009 +0000

    gschem: Fix rubberbanding of arcs with negative end_angles
    
    Such arcs are typically generated by mirroring. If the arc being
    rubberbanded previously had a negative sweep, keep that the case
    in the rubberbanded version.
    
    Also fixes a bug where we're rubberband to give a zero degree sweep
    arc rather than a 360 degree one.

diff --git a/gschem/src/o_arc.c b/gschem/src/o_arc.c
index a9eba03..ba2dedf 100644
--- a/gschem/src/o_arc.c
+++ b/gschem/src/o_arc.c
@@ -354,18 +354,23 @@ void o_arc_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y, int whichone)
   }
   else if((whichone == ARC_START_ANGLE) || (whichone == ARC_END_ANGLE)) {
     /* compute the angle */
-    diff_x = w_current->first_wx - w_x;
-    diff_y = w_current->first_wy - w_y;
-    angle_deg = atan2(diff_y, diff_x) * 180 / M_PI;
+    diff_x = w_x - w_current->first_wx;
+    diff_y = w_y - w_current->first_wy;
+    angle_deg = atan2 (diff_y, diff_x) * 180 / M_PI;
 
     /* set the start or end angle with this angle */
     switch(whichone) {
     case ARC_START_ANGLE:
-      w_current->second_wx = (angle_deg + 360 + 180) % 360;
+      w_current->second_wx = (angle_deg + 360) % 360;
       break;
 	
     case ARC_END_ANGLE:
-      w_current->second_wy = (angle_deg - w_current->second_wx + 720 + 180) % 360;
+      w_current->second_wy = (((angle_deg + 360) % 360) -
+                              w_current->second_wx + 360) % 360;
+      if (w_current->which_object->arc->end_angle < 0)
+        w_current->second_wy = w_current->second_wy - 360;
+      if (w_current->second_wy == 0)
+        w_current->second_wy = 360;
       break;
 	
     default:

commit d6c486a1fac1abce71b8805285fef664e252af98
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 4 17:48:18 2009 +0000

    gschem: Alter order of grip search when rubberbanding arcs
    
    If you inadvertently land the grip which adjusts the sweep
    of the arc on top of the one which sets its offset angle, it is
    impossible to do anything but rotate the whole arc segment.

diff --git a/gschem/src/o_grips.c b/gschem/src/o_grips.c
index 8ae6fe6..ec28bb4 100644
--- a/gschem/src/o_grips.c
+++ b/gschem/src/o_grips.c
@@ -221,21 +221,21 @@ OBJECT *o_grips_search_arc_world(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current,
     return(o_current);
   }
 
-  /* check the grip at the start angle of the arc */
-  tmp = ((double) start_angle) * M_PI / 180;
+  /* check the grip at the end angle of the arc */
+  tmp = ((double) start_angle + end_angle) * M_PI / 180;
   if (inside_grip(x, y,
                   centerx + radius * cos(tmp),
                   centery + radius * sin(tmp), size)) {
-    *whichone = ARC_START_ANGLE;
+    *whichone = ARC_END_ANGLE;
     return(o_current);
   }
 
-  /* check the grip at the end angle of the arc */
-  tmp = ((double) start_angle + end_angle) * M_PI / 180;
+  /* check the grip at the start angle of the arc */
+  tmp = ((double) start_angle) * M_PI / 180;
   if (inside_grip(x, y,
                   centerx + radius * cos(tmp),
                   centery + radius * sin(tmp), size)) {
-    *whichone = ARC_END_ANGLE;
+    *whichone = ARC_START_ANGLE;
     return(o_current);
   }
 




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