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

gEDA-cvs: CVS update: o_text.c



  User: pcjc2   
  Date: 07/03/23 20:58:07

  Modified:    .        Tag: noscreen o_text.c
  Log:
  Modified text o_text_draw_rectangle() to use the world bounds of the text,
  
  fixing the outline offset when the text is aligned other than bottom, left.
  
  
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.25.2.6  +18 -58    eda/geda/gaf/gschem/src/o_text.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_text.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_text.c,v
  retrieving revision 1.25.2.5
  retrieving revision 1.25.2.6
  diff -u -b -r1.25.2.5 -r1.25.2.6
  --- o_text.c	25 Feb 2007 14:37:39 -0000	1.25.2.5
  +++ o_text.c	24 Mar 2007 00:58:07 -0000	1.25.2.6
  @@ -91,7 +91,9 @@
     /* text is too small so go through and draw a rectangle in
        it's place */
   	
  -  WORLDtoSCREEN( w_current, o_current->text->x, o_current->text->y, &screen_x1, &screen_y1 );
  +  /* NOTE THAT THE TOP AND BOTTOM ARE REVERSED THROUGHT THE WHOLE OF GEDA FOR WORLD COORDS */
  +  WORLDtoSCREEN( w_current, o_current->w_left, o_current->w_bottom, &left, &top );
  +  WORLDtoSCREEN( w_current, o_current->w_right, o_current->w_top, &right, &bottom );
   
     if (w_current->override_color != -1 ) {  /* Override */
       color = x_get_color(w_current->override_color);
  @@ -100,63 +102,21 @@
     }
     gdk_gc_set_foreground(w_current->gc, color);
   
  -
  -  width = SCREENabs(w_current, o_current->text->displayed_width);
  -  height = SCREENabs(w_current, o_current->text->displayed_height);
  -      
  -  switch(o_current->text->angle) {
  -    case(0):
  -      left = screen_x1+dx;
  -      top = screen_y1+dy-height;
  -      right = width;
  -      bottom = height;
  -      break;
  -	
  -    case(90):
  -      left = screen_x1+dx-height;
  -      top = screen_y1+dy-width;
  -      right = height;
  -      bottom = width;
  -      break;
  -	  
  -    case(180):
  -      left = screen_x1+dx-width;
  -      top = screen_y1+dy;
  -      right = width;
  -      bottom = height;
  -      break;
  -	
  -    case(270):
  -      left = screen_x1+dx;
  -      top = screen_y1+dy;
  -      right = height;
  -      bottom = width;
  -      break;
  -
  -    default:
  -      s_log_message(_("Tried to render text with an invalid angle: %d\n"),
  -                    o_current->text->angle); 
  -      return;
  -      break;
  -  }
  -
  -  /* The right, bottom variables are really just the width and height and */
  -  /* not the "right" or "bottom". */
     if (w_current->DONT_REDRAW == 0) {
  -    gdk_draw_rectangle(w_current->window,
  +    gdk_draw_rectangle( w_current->window,
   		       w_current->gc,
   		       FALSE,
   		       left, 
   		       top,
  -		       right,
  -		       bottom);
  -    gdk_draw_rectangle(w_current->backingstore,
  +                        right - left,
  +                        bottom - top );
  +    gdk_draw_rectangle( w_current->backingstore,
   		       w_current->gc,
   		       FALSE,
   		       left, 
   		       top,
  -		       right,
  -		       bottom);
  +                        right - left,
  +                        bottom - top );
     }
   
   #if 0 /* in prep for future performance enhancement */
  
  
  


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