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

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-19-g5453f26)



The branch, master has been updated
       via  5453f2680e45dd3f2ffde73f442ba18a6a180437 (commit)
       via  b43dd2d3dfa1f50c788c87215a3e080bdb4448ea (commit)
       via  96ac0c7622c909604f925ae2a5e242a46ed0b53a (commit)
       via  56985b0d059fc0487f7b8245cad7b468e737f2fe (commit)
       via  d63a40cef31791c8c5209f3695f14c3cdf29ba5d (commit)
      from  e7fe069ae882f8c0d398cac1b426b8a7df6fff53 (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_basic.c             |    2 +-
 libgeda/include/prototype.h      |    4 +-
 libgeda/include/prototype_priv.h |    2 +-
 libgeda/src/o_basic.c            |    4 +++
 libgeda/src/o_text_basic.c       |    6 ++--
 libgeda/src/s_page.c             |   39 ++++++++++++++++++++++---------------
 libgeda/src/s_path.c             |   12 ++++++++--
 7 files changed, 43 insertions(+), 26 deletions(-)


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

commit 5453f2680e45dd3f2ffde73f442ba18a6a180437
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:39 2008 +0000

    libgeda: Don't pro-actively calculate text bounds, wait until needed.

:100644 100644 2e1c813... 082efd4... M	libgeda/src/o_text_basic.c

commit b43dd2d3dfa1f50c788c87215a3e080bdb4448ea
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:33 2008 +0000

    libgeda: Add missing case in o_recalc_single_object() for text OBJECTs

:100644 100644 0fabab1... 32c0e10... M	libgeda/src/o_basic.c

commit 96ac0c7622c909604f925ae2a5e242a46ed0b53a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:25 2008 +0000

    Use world_get_single_object_bounds() in s_page_get_objects_in_regions()
    
    This allows us to ensure the bounds are valid, and trigger a recalc as
    necessary.

:100644 100644 50022ac... 0a80c92... M	libgeda/src/s_page.c

commit 56985b0d059fc0487f7b8245cad7b468e737f2fe
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:18 2008 +0000

    Change s_page_get_objects_in_region[s]() to take a TOPLEVEL parameter
    
    This is needed in case we have to re-calculate the bounds of any object.

:100644 100644 6e4888e... 7d179c6... M	gschem/src/o_basic.c
:100644 100644 1142eed... 27fed4a... M	libgeda/include/prototype.h
:100644 100644 978bfa4... 50022ac... M	libgeda/src/s_page.c

commit d63a40cef31791c8c5209f3695f14c3cdf29ba5d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:14 2008 +0000

    libgeda: Fix selection of non-filled paths along their closing edge.
    
    If the path is closed, we want to be able to select along the
    closing line.

:100644 100644 8befc83... 0bcb657... M	libgeda/include/prototype_priv.h
:100644 100644 f0949e8... 4ced308... M	libgeda/src/s_path.c

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

commit 5453f2680e45dd3f2ffde73f442ba18a6a180437
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:39 2008 +0000

    libgeda: Don't pro-actively calculate text bounds, wait until needed.

diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index 2e1c813..082efd4 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -995,7 +995,7 @@ OBJECT *o_text_new(TOPLEVEL *toplevel,
   }
 
   /* Update bounding box */
-  o_text_recalc( toplevel, new_node );
+  new_node->w_bounds_valid = FALSE;
 
   g_free(name);
   g_free(value);
@@ -1338,7 +1338,7 @@ void o_text_recreate(TOPLEVEL *toplevel, OBJECT *o_current)
     text->displayed_height = 0;
   }
 
-  o_text_recalc( toplevel, o_current );
+  o_current->w_bounds_valid = FALSE;
 
   g_free(name);
   g_free(value);
@@ -1362,7 +1362,7 @@ void o_text_translate_world(TOPLEVEL *toplevel,
   o_glist_translate_world (toplevel, dx, dy, o_current->text->prim_objs);
 
   /* Update bounding box */
-  o_text_recalc( toplevel, o_current );
+  o_current->w_bounds_valid = FALSE;
 }
 
 /*! \brief create a copy of a text object

commit b43dd2d3dfa1f50c788c87215a3e080bdb4448ea
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:33 2008 +0000

    libgeda: Add missing case in o_recalc_single_object() for text OBJECTs

diff --git a/libgeda/src/o_basic.c b/libgeda/src/o_basic.c
index 0fabab1..32c0e10 100644
--- a/libgeda/src/o_basic.c
+++ b/libgeda/src/o_basic.c
@@ -134,6 +134,10 @@ void o_recalc_single_object(TOPLEVEL *toplevel, OBJECT *o_current)
       case(OBJ_ARC):
         o_arc_recalc(toplevel, o_current);
         break;
+
+      case(OBJ_TEXT):
+        o_text_recalc(toplevel, o_current);
+        break;
     }
   }
 }

commit 96ac0c7622c909604f925ae2a5e242a46ed0b53a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:25 2008 +0000

    Use world_get_single_object_bounds() in s_page_get_objects_in_regions()
    
    This allows us to ensure the bounds are valid, and trigger a recalc as
    necessary.

diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index 50022ac..0a80c92 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -601,10 +601,14 @@ GList *s_page_objects_in_regions (TOPLEVEL *toplevel, PAGE *page,
     OBJECT *object = iter->data;
 
     for (i = 0; i < n_rects; i++) {
-      if (object->w_right  >= rects[i].lower_x &&
-          object->w_left   <= rects[i].upper_x &&
-          object->w_top    <= rects[i].upper_y &&
-          object->w_bottom >= rects[i].lower_y) {
+      int left, top, right, bottom;
+
+      if (world_get_single_object_bounds (toplevel, object,
+                                          &left, &top, &right, &bottom) &&
+          right  >= rects[i].lower_x &&
+          left   <= rects[i].upper_x &&
+          top    <= rects[i].upper_y &&
+          bottom >= rects[i].lower_y) {
         list = g_list_prepend (list, object);
         break;
       }

commit 56985b0d059fc0487f7b8245cad7b468e737f2fe
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:18 2008 +0000

    Change s_page_get_objects_in_region[s]() to take a TOPLEVEL parameter
    
    This is needed in case we have to re-calculate the bounds of any object.

diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 6e4888e..7d179c6 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -81,7 +81,7 @@ void o_redraw_rects (GSCHEM_TOPLEVEL *w_current,
                    &world_rects[i].upper_x, &world_rects[i].upper_y);
   }
 
-  obj_list = s_page_objects_in_regions (toplevel->page_current,
+  obj_list = s_page_objects_in_regions (toplevel, toplevel->page_current,
                                         world_rects, n_rectangles);
   g_free (world_rects);
 
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 1142eed..27fed4a 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -416,8 +416,8 @@ gint s_page_autosave (TOPLEVEL *toplevel);
 void s_page_append (PAGE *page, OBJECT *object);
 void s_page_remove (PAGE *page, OBJECT *object);
 void s_page_delete_objects (TOPLEVEL *toplevel, PAGE *page);
-GList *s_page_objects_in_region (PAGE *page, int min_x, int min_y, int max_x, int max_y);
-GList *s_page_objects_in_regions (PAGE *page, BOX *rects, int n_rects);
+GList *s_page_objects_in_region (TOPLEVEL *toplevel, PAGE *page, int min_x, int min_y, int max_x, int max_y);
+GList *s_page_objects_in_regions (TOPLEVEL *toplevel, PAGE *page, BOX *rects, int n_rects);
 
 /* s_papersizes.c */
 int s_papersizes_add_entry(char *new_papersize, int width, int height);
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index 978bfa4..50022ac 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -557,15 +557,16 @@ void s_page_delete_objects (TOPLEVEL *toplevel, PAGE *page)
  *  Finds the objects which are inside, or intersect
  *  the passed box shaped region.
  *
- *  \param [in] page    The PAGE the object is on.
- *  \param [in] min_x   The smaller X coordinate of the region.
- *  \param [in] min_y   The smaller Y coordinate of the region.
- *  \param [in] max_x   The larger  X coordinate of the region.
- *  \param [in] max_y   The larger  Y coordinate of the region.
+ *  \param [in] toplevel  The TOPLEVEL object.
+ *  \param [in] page      The PAGE to find objects on.
+ *  \param [in] min_x     The smaller X coordinate of the region.
+ *  \param [in] min_y     The smaller Y coordinate of the region.
+ *  \param [in] max_x     The larger  X coordinate of the region.
+ *  \param [in] max_y     The larger  Y coordinate of the region.
  *  \return The GList of OBJECTs in the region.
  */
-GList *s_page_objects_in_region (PAGE *page, int min_x, int min_y,
-                                             int max_x, int max_y)
+GList *s_page_objects_in_region (TOPLEVEL *toplevel, PAGE *page,
+                                 int min_x, int min_y, int max_x, int max_y)
 {
   BOX rect;
 
@@ -574,7 +575,7 @@ GList *s_page_objects_in_region (PAGE *page, int min_x, int min_y,
   rect.upper_x = max_x;
   rect.upper_y = max_y;
 
-  return s_page_objects_in_regions (page, &rect, 1);
+  return s_page_objects_in_regions (toplevel, page, &rect, 1);
 }
 
 /*! \brief Find the objects in a given region
@@ -583,12 +584,14 @@ GList *s_page_objects_in_region (PAGE *page, int min_x, int min_y,
  *  Finds the objects which are inside, or intersect
  *  the passed box shaped region.
  *
- *  \param [in] page     The PAGE the object is on.
- *  \param [in] rects    The BOX regions to check.
- *  \param [in] n_rects  The number of regions.
+ *  \param [in] toplevel  The TOPLEVEL object.
+ *  \param [in] page      The PAGE to find objects on.
+ *  \param [in] rects     The BOX regions to check.
+ *  \param [in] n_rects   The number of regions.
  *  \return The GList of OBJECTs in the region.
  */
-GList *s_page_objects_in_regions (PAGE *page, BOX *rects, int n_rects)
+GList *s_page_objects_in_regions (TOPLEVEL *toplevel, PAGE *page,
+                                  BOX *rects, int n_rects)
 {
   GList *iter;
   GList *list = NULL;

commit d63a40cef31791c8c5209f3695f14c3cdf29ba5d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:33:14 2008 +0000

    libgeda: Fix selection of non-filled paths along their closing edge.
    
    If the path is closed, we want to be able to select along the
    closing line.

diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index 8befc83..0bcb657 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -222,7 +222,7 @@ gchar* s_encoding_base64_encode (gchar* src, guint srclen, guint* dstlenp, gbool
 gchar* s_encoding_base64_decode (gchar* src, guint srclen, guint* dstlenp);
 
 /* s_path.c */
-void s_path_to_polygon(PATH *path, GArray *points);
+int s_path_to_polygon(PATH *path, GArray *points);
 double s_path_shortest_distance (PATH *path, int x, int y, int solid);
 
 /* s_textbuffer.c */
diff --git a/libgeda/src/s_path.c b/libgeda/src/s_path.c
index f0949e8..4ced308 100644
--- a/libgeda/src/s_path.c
+++ b/libgeda/src/s_path.c
@@ -705,9 +705,11 @@ char *s_path_string_from_path (const PATH *path)
  *  be NULL.
  *  \param points [out] An array of the polygon's vertices.  This parameter
  *  must not be NULL.
+ *  \return TRUE if the path is closed, FALSE if it is open.
  */
-void s_path_to_polygon (PATH *path, GArray *points)
+int s_path_to_polygon (PATH *path, GArray *points)
 {
+  int closed = FALSE;
   int i;
   sPOINT point = { 0, 0 };
 
@@ -744,9 +746,12 @@ void s_path_to_polygon (PATH *path, GArray *points)
         break;
 
       case PATH_END:
+        closed = TRUE;
         break;
     }
   }
+
+  return closed;
 }
 
 
@@ -765,14 +770,15 @@ void s_path_to_polygon (PATH *path, GArray *points)
 double s_path_shortest_distance (PATH *path, int x, int y, int solid)
 {
   double shortest_distance = G_MAXDOUBLE;
+  int closed;
   GArray *points;
 
   points = g_array_new (FALSE, FALSE, sizeof (sPOINT));
 
-  s_path_to_polygon (path, points);
+  closed = s_path_to_polygon (path, points);
 
   if (!solid) {
-    shortest_distance = m_polygon_shortest_distance (points, x, y, FALSE);
+    shortest_distance = m_polygon_shortest_distance (points, x, y, closed);
 
   } else if (m_polygon_interior_point (points, x, y)) {
     shortest_distance = 0;




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