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

gEDA-cvs: CVS update: o_text_basic.c



  User: pcjc2   
  Date: 07/04/16 10:17:39

  Modified:    .        Tag: noscreen o_text_basic.c
  Log:
  Use o_text_recalc() to update text bounds, as we don't want to duplicate code.
  
  Fixes a bug where the bounds were reset manually even with invisible text
  
  (causing uninitialised values to be stored in for the object's bounds).
  
  Fixed o_text_recalc() to silently return (rather than write uninitialised
  
  values) if no bound was found for the text object's prim_objects.
  
  
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.25.2.7  +9 -23     eda/geda/gaf/libgeda/src/o_text_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_text_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_text_basic.c,v
  retrieving revision 1.25.2.6
  retrieving revision 1.25.2.7
  diff -u -b -r1.25.2.6 -r1.25.2.7
  --- o_text_basic.c	25 Feb 2007 13:43:20 -0000	1.25.2.6
  +++ o_text_basic.c	16 Apr 2007 14:17:39 -0000	1.25.2.7
  @@ -875,7 +875,6 @@
     OBJECT *temp_list=NULL;
     OBJECT *temp_parent=NULL;
     TEXT *text;
  -  int left, right, top, bottom;
     char *name = NULL;
     char *value = NULL; 
     char *output_string = NULL;
  @@ -977,13 +976,8 @@
   
     w_current->page_current->object_parent = temp_parent;
   
  -  world_get_text_bounds(w_current, object_list, &left, &top, &right, &bottom);
  -
  -  /* set the new object's bounding box */
  -  object_list->w_left = left;
  -  object_list->w_top = top;
  -  object_list->w_right = right;
  -  object_list->w_bottom = bottom;
  +  /* Update bounding box */
  +  o_text_recalc( w_current, object_list );
   
     if (name) g_free(name);
     if (value) g_free(value);
  @@ -1004,13 +998,13 @@
       return;
     }
   
  -  world_get_object_list_bounds(w_current, o_current->text->prim_objs, 
  -			 &left, &top, &right, &bottom);
  +  if ( !world_get_text_bounds(w_current, o_current, &left, &top, &right, &bottom) )
  +    return;
  +
     o_current->w_left = left;
     o_current->w_top = top;
     o_current->w_right = right;
     o_current->w_bottom = bottom;
  -
   }
   
   /*! \todo Finish function documentation!!!
  @@ -1357,21 +1351,13 @@
   void o_text_translate_world(TOPLEVEL *w_current,
   			    int x1, int y1, OBJECT *o_current)
   {
  -  int left, right, top, bottom;
  -	
  -	
     o_current->text->x = o_current->text->x + x1;
     o_current->text->y = o_current->text->y + y1;
   
     o_complex_world_translate(w_current, x1, y1, o_current->text->prim_objs);
   		
     /* Update bounding box */
  -  world_get_text_bounds(w_current, o_current, &left, &top, &right, &bottom);
  -
  -  o_current->w_left = left;
  -  o_current->w_top = top;
  -  o_current->w_right = right;
  -  o_current->w_bottom = bottom;
  +  o_text_recalc( w_current, o_current );
   }
   
   /*! \todo Finish function documentation!!!
  
  
  


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