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

gEDA-cvs: CVS update: o_arc.c



  User: pcjc2   
  Date: 07/02/11 21:19:38

  Modified:    .        Tag: noscreen o_arc.c o_box.c o_bus.c o_circle.c
                        o_line.c o_net.c o_picture.c o_pin.c o_select.c
                        o_text.c
  Log:
  Modified drawing routines to calculate coordinates directly from object 
  
  world coords.
  
  
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.26.2.2  +15 -16    eda/geda/gaf/gschem/src/o_arc.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_arc.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_arc.c,v
  retrieving revision 1.26.2.1
  retrieving revision 1.26.2.2
  diff -u -b -r1.26.2.1 -r1.26.2.2
  --- o_arc.c	12 Feb 2007 02:18:34 -0000	1.26.2.1
  +++ o_arc.c	12 Feb 2007 02:19:38 -0000	1.26.2.2
  @@ -108,20 +108,19 @@
      * encountered the arc is drawn as a solid arc independently of its
      * initial type.
      */
  -  x      = o_current->arc->screen_x;
  -  y      = o_current->arc->screen_y;
  -  radius = o_current->arc->screen_width / 2;
  +  WORLDtoSCREEN( w_current, o_current->arc->x, o_current->arc->y, &x, &y );
  +  radius = SCREENabs( w_current, o_current->arc->width / 2 );
     start_angle = o_current->arc->start_angle;
     end_angle   = o_current->arc->end_angle;
   
   #if DEBUG 
     printf("drawing arc x: %d y: %d sa: %d ea: %d width: %d height: %d\n",
  -         o_current->arc->screen_x,
  -         o_current->arc->screen_y, 
  +         x,
  +         y, 
            o_current->arc->start_angle, 
            o_current->arc->end_angle,
  -         o_current->arc->screen_width, 
  -         o_current->arc->screen_height);
  +         radius, 
  +         radius);
   #endif
   
     if (w_current->override_color != -1 )
  @@ -129,9 +128,8 @@
     else
       color = x_get_color(o_current->color);
   
  -  if(o_current->screen_line_width > 0) {
  -    arc_width = o_current->screen_line_width;
  -  } else {
  +  arc_width = SCREENabs( w_current, o_current->line_width );
  +  if(arc_width <= 0) {
       arc_width = 1;
     }
   	
  @@ -144,8 +142,8 @@
       break;
     }
   
  -  length = o_current->screen_line_length;
  -  space = o_current->screen_line_space;
  +  length = SCREENabs( w_current, o_current->line_length );
  +  space = SCREENabs( w_current, o_current->line_space );
   	
     switch(o_current->line_type) {
     case TYPE_SOLID:
  @@ -859,12 +857,13 @@
     }
   
     /* diameter */
  -  width       = o_current->arc->screen_width;
  +  width       = SCREENabs( w_current, o_current->arc->width );
     /* height MUST be equal to width, just another name for diameter */
  -  height      = o_current->arc->screen_height;
  +  height      = SCREENabs( w_current, o_current->arc->height );
     /* center */
  -  x           = o_current->arc->screen_x - (width  / 2);
  -  y           = o_current->arc->screen_y - (height / 2);
  +  WORLDtoSCREEN( w_current, o_current->arc->x, o_current->arc->y, &x, &y );
  +  x           -= (width  / 2);
  +  y           -= (height / 2);
     /* start and end angles */
     start_angle = o_current->arc->start_angle;
     end_angle   = o_current->arc->end_angle;
  
  
  
  1.24.2.2  +41 -47    eda/geda/gaf/gschem/src/o_box.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_box.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_box.c,v
  retrieving revision 1.24.2.1
  retrieving revision 1.24.2.2
  diff -u -b -r1.24.2.1 -r1.24.2.2
  --- o_box.c	12 Feb 2007 02:18:34 -0000	1.24.2.1
  +++ o_box.c	12 Feb 2007 02:19:38 -0000	1.24.2.2
  @@ -55,6 +55,7 @@
   void o_box_draw(TOPLEVEL *w_current, OBJECT *o_current)
   {
     int wleft, wright, wtop, wbottom; /* world bounds */
  +  int s_upper_x, s_upper_y, s_lower_x, s_lower_y;
     int line_width, length, space;
     int fill_width, angle1, pitch1, angle2, pitch2;
     GdkCapStyle box_end;
  @@ -89,14 +90,14 @@
     printf("drawing box\n\n");
   	
     printf("drawing box: %d %d %d %d\n",
  -         o_current->box->screen_upper_x,
  -         o_current->box->screen_upper_y,
  -         o_current->box->screen_upper_x +
  -         abs(o_current->box->screen_lower_x -
  -             o_current->box->screen_upper_x),
  -         o_current->box->screen_upper_y +
  -         abs(o_current->box->screen_lower_y -
  -             o_current->box->screen_upper_y));
  +         o_current->box->upper_x,
  +         o_current->box->upper_y,
  +         o_current->box->upper_x +
  +         abs(o_current->box->lower_x -
  +             o_current->box->upper_x),
  +         o_current->box->upper_y +
  +         abs(o_current->box->lower_y -
  +             o_current->box->upper_y));
   #endif
   
     /*
  @@ -126,9 +127,8 @@
      * encountered the box is drawn as a solid box independently of its
      * initial type.
      */
  -  if(o_current->screen_line_width > 0) {
  -    line_width = o_current->screen_line_width;
  -  } else {
  +  line_width = SCREENabs( w_current, o_current->line_width );
  +  if(line_width <= 0) {
       line_width = 1;
     }
   
  @@ -141,8 +141,8 @@
       break;
     }
   	
  -  length = o_current->screen_line_length;
  -  space = o_current->screen_line_space;
  +  length = SCREENabs( w_current, o_current->line_length );
  +  space = SCREENabs( w_current, o_current->line_space );
   	
     switch(o_current->line_type) {
       case TYPE_SOLID:
  @@ -183,23 +183,22 @@
     if((length == 0) || (space == 0))
     draw_func = o_box_draw_solid;
   	
  +  WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->upper_y, 
  +                 &s_upper_x, &s_upper_y );
  +  WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->lower_y, 
  +                 &s_lower_x, &s_lower_y );
  +	
     (*draw_func)(w_current->window, w_current->gc, color, box_end,
                  FALSE,
  -               o_current->box->screen_upper_x,
  -               o_current->box->screen_upper_y,
  -               abs(o_current->box->screen_lower_x -
  -                   o_current->box->screen_upper_x),
  -               abs(o_current->box->screen_lower_y -
  -                   o_current->box->screen_upper_y),
  +               s_upper_x, s_upper_y,
  +               abs(s_lower_x - s_upper_x),
  +               abs(s_lower_y - s_upper_y),
                  line_width, length, space);
     (*draw_func)(w_current->backingstore, w_current->gc, color, box_end,
                  FALSE,
  -               o_current->box->screen_upper_x,
  -               o_current->box->screen_upper_y,
  -               abs(o_current->box->screen_lower_x -
  -                   o_current->box->screen_upper_x),
  -               abs(o_current->box->screen_lower_y -
  -                   o_current->box->screen_upper_y),
  +               s_upper_x, s_upper_y,
  +               abs(s_lower_x - s_upper_x),
  +               abs(s_lower_y - s_upper_y),
                  line_width, length, space);
   
     /*
  @@ -224,16 +223,15 @@
      * to be distinct. If such a case is encountered the circle is filled
      * hollow (e.q. not filled).
      */
  -  if(o_current->screen_fill_width > 0) {
  -    fill_width = o_current->screen_fill_width;
  -  } else {
  +  fill_width = SCREENabs( w_current, o_current->fill_width );
  +  if(fill_width <= 0) {
       fill_width = 1;
     }
   	
     angle1 = o_current->fill_angle1;
  -  pitch1 = o_current->screen_fill_pitch1;
  +  pitch1 = SCREENabs( w_current, o_current->fill_pitch1 );
     angle2 = o_current->fill_angle2;
  -  pitch2 = o_current->screen_fill_pitch2;
  +  pitch2 = SCREENabs( w_current, o_current->fill_pitch2 );
   	
     switch(o_current->fill_type) {
       case FILLING_HOLLOW:
  @@ -276,20 +274,16 @@
     }
   
     (*fill_func)(w_current->window, w_current->gc, color,
  -               o_current->box->screen_upper_x,
  -               o_current->box->screen_upper_y,
  -               abs(o_current->box->screen_lower_x -
  -                   o_current->box->screen_upper_x),
  -               abs(o_current->box->screen_lower_y -
  -                   o_current->box->screen_upper_y),
  +               FALSE,
  +               s_upper_x, s_upper_y,
  +               abs(s_lower_x - s_upper_x),
  +               abs(s_lower_y - s_upper_y),
                  fill_width, angle1, pitch1, angle2, pitch2);
     (*fill_func)(w_current->backingstore, w_current->gc, color,
  -               o_current->box->screen_upper_x,
  -               o_current->box->screen_upper_y,
  -               abs(o_current->box->screen_lower_x -
  -                   o_current->box->screen_upper_x),
  -               abs(o_current->box->screen_lower_y -
  -                   o_current->box->screen_upper_y),
  +               FALSE,
  +               s_upper_x, s_upper_y,
  +               abs(s_lower_x - s_upper_x),
  +               abs(s_lower_y - s_upper_y),
                  fill_width, angle1, pitch1, angle2, pitch2);
   
     if ((o_current->draw_grips == TRUE) && (w_current->draw_grips == TRUE)) {
  @@ -872,10 +866,10 @@
       return;
     }
   
  -  screen_x1 = o_current->box->screen_upper_x;
  -  screen_y1 = o_current->box->screen_upper_y;
  -  screen_x2 = o_current->box->screen_lower_x;
  -  screen_y2 = o_current->box->screen_lower_y;
  +  WORLDtoSCREEN( w_current, o_current->box->upper_x, o_current->box->upper_y, 
  +                 &screen_x1, &screen_y1 );
  +  WORLDtoSCREEN( w_current, o_current->box->lower_x, o_current->box->lower_y, 
  +                 &screen_x2, &screen_y2 );
   
     if (o_current->saved_color != -1) {
       color = o_current->saved_color;
  
  
  
  1.21.6.3  +12 -8     eda/geda/gaf/gschem/src/o_bus.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_bus.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_bus.c,v
  retrieving revision 1.21.6.2
  retrieving revision 1.21.6.3
  diff -u -b -r1.21.6.2 -r1.21.6.3
  --- o_bus.c	11 Feb 2007 23:58:56 -0000	1.21.6.2
  +++ o_bus.c	12 Feb 2007 02:19:38 -0000	1.21.6.3
  @@ -132,6 +132,7 @@
   {
     int size;
     int color;
  +  int sx[2], sy[2];
   
     if (o_current->line == NULL) {
       return;
  @@ -154,11 +155,12 @@
                                  GDK_JOIN_MITER);
     }
   
  +  WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
  +  WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
  +  
     gdk_draw_line(w_current->window, w_current->outline_xor_gc,
  -                o_current->line->screen_x[0]+dx,
  -                o_current->line->screen_y[0]+dy,
  -                o_current->line->screen_x[1]+dx,
  -                o_current->line->screen_y[1]+dy);
  +                sx[0]+dx, sy[0]+dy,
  +                sx[1]+dx, sy[1]+dy);
   
     /* backing store ? not approriate here */
   
  @@ -180,6 +182,7 @@
   {
     int color;
     int dx1= - 1, dy1 = - 1, dx2 = -1, dy2 = -1;
  +  int sx[2], sy[2];
   
     if (o_current->line == NULL) {
       return;
  @@ -218,11 +221,12 @@
       fprintf(stderr, _("Got an invalid which one in o_bus_draw_xor_single\n"));
     }
   
  +  WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
  +  WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
  +
     gdk_draw_line(w_current->window, w_current->outline_xor_gc,
  -                o_current->line->screen_x[0]+dx1,
  -                o_current->line->screen_y[0]+dy1,
  -                o_current->line->screen_x[1]+dx2,
  -                o_current->line->screen_y[1]+dy2);
  +                sx[0]+dx1, sy[0]+dy1,
  +                sx[1]+dx2, sy[1]+dy2);
   
     /* backing store ? not approriate here */
   
  
  
  
  1.22.2.2  +22 -22    eda/geda/gaf/gschem/src/o_circle.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_circle.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_circle.c,v
  retrieving revision 1.22.2.1
  retrieving revision 1.22.2.2
  diff -u -b -r1.22.2.1 -r1.22.2.2
  --- o_circle.c	12 Feb 2007 02:18:35 -0000	1.22.2.1
  +++ o_circle.c	12 Feb 2007 02:19:38 -0000	1.22.2.2
  @@ -51,6 +51,7 @@
   void o_circle_draw(TOPLEVEL *w_current, OBJECT *o_current)
   {
     int wleft, wright, wtop, wbottom; /* world bounds */
  +  int s_x, s_y;
     int radius;
     int circle_width, length, space;
     int fill_width, angle1, pitch1, angle2, pitch2;
  @@ -100,7 +101,7 @@
       color = x_get_color(o_current->color);
     }
   
  -  radius = o_current->circle->screen_radius;
  +  radius = SCREENabs( w_current, o_current->circle->radius );
   
     /*
      * The values describing the line type are extracted from the
  @@ -118,14 +119,13 @@
      * to an endless loop in function called after. If such a case is encountered
      * the circle is drawn as a solid circle independently of its initial type.
      */
  -  if(o_current->screen_line_width > 0) {
  -    circle_width = o_current->screen_line_width;
  -  } else {
  +  circle_width = SCREENabs( w_current, o_current->line_width );
  +  if(circle_width <= 0) {
       circle_width = 1;
     }
   
  -  length = o_current->screen_line_length;
  -  space = o_current->screen_line_space;
  +  length = SCREENabs( w_current, o_current->line_length );
  +  space = SCREENabs( w_current, o_current->line_space );
   
     switch(o_current->line_end) {
       case END_NONE:   circle_end = GDK_CAP_BUTT;       break;
  @@ -175,17 +175,18 @@
     if((length == 0) || (space == 0))
     draw_func = o_arc_draw_solid;
   	
  +  WORLDtoSCREEN( w_current, o_current->circle->center_x, o_current->circle->center_y,
  +                 &s_x, &s_y );
  +	
     (*draw_func)(w_current->window, w_current->gc, color,
                  circle_end,
  -               o_current->circle->screen_x,
  -               o_current->circle->screen_y,
  +               s_x, s_y,
                  radius,
                  0, FULL_CIRCLE / 64,
                  circle_width, length, space);
     (*draw_func)(w_current->backingstore, w_current->gc, color,
                  circle_end,
  -               o_current->circle->screen_x,
  -               o_current->circle->screen_y,
  +               s_x, s_y,
                  radius,
                  0, FULL_CIRCLE / 64,
                  circle_width, length, space);
  @@ -211,16 +212,15 @@
      * distinct. If such a case is encountered the circle is filled hollow
      * (e.q. not filled).
      */
  -  if(o_current->screen_fill_width > 0) {
  -    fill_width = o_current->screen_fill_width;
  -  } else {
  +  fill_width = SCREENabs( w_current, o_current->fill_width );
  +  if( fill_width <= 0) {
       fill_width = 1;
     }
   	
     angle1 = o_current->fill_angle1;
  -  pitch1 = o_current->screen_fill_pitch1;
  +  pitch1 = SCREENabs( w_current, o_current->fill_pitch1 );
     angle2 = o_current->fill_angle2;
  -  pitch2 = o_current->screen_fill_pitch2;
  +  pitch2 = SCREENabs( w_current, o_current->fill_pitch2 );
   	
     switch(o_current->fill_type) {
       case FILLING_HOLLOW:
  @@ -263,13 +263,11 @@
     }
   
     (*fill_func)(w_current->window, w_current->gc, color,
  -               o_current->circle->screen_x,
  -               o_current->circle->screen_y,
  +               s_x, s_y,
                  radius,
                  fill_width, angle1, pitch1, angle2, pitch2);
     (*fill_func)(w_current->backingstore, w_current->gc, color,
  -               o_current->circle->screen_x,
  -               o_current->circle->screen_y,
  +               s_x, s_y,
                  radius,
                  fill_width, angle1, pitch1, angle2, pitch2);
   
  @@ -567,11 +565,13 @@
     }
   
     /* radius of the circle */
  -  radius = o_current->circle->screen_radius;
  +  radius = SCREENabs( w_current, o_current->circle->radius );
     /* upper left corner of the square the circle is inscribed in */
     /* gdk coords system */
  -  x = o_current->circle->screen_x - o_current->circle->screen_radius;
  -  y = o_current->circle->screen_y - o_current->circle->screen_radius;
  +  WORLDtoSCREEN( w_current,
  +                 o_current->circle->center_x - o_current->circle->radius,
  +                 o_current->circle->center_y + o_current->circle->radius,
  +                 &x, &y );
     
     /* translate the upper left corner */
     x = x + dx;
  
  
  
  1.23.2.2  +13 -11    eda/geda/gaf/gschem/src/o_line.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_line.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_line.c,v
  retrieving revision 1.23.2.1
  retrieving revision 1.23.2.2
  diff -u -b -r1.23.2.1 -r1.23.2.2
  --- o_line.c	12 Feb 2007 02:18:35 -0000	1.23.2.1
  +++ o_line.c	12 Feb 2007 02:19:38 -0000	1.23.2.2
  @@ -73,8 +73,8 @@
   #if DEBUG
     printf("drawing line\n\n");
     printf("drawing line : %d,%d to %d,%d\n",
  -         o_current->line->x1, o_current->line->y1,
  -         o_current->line->x2, o_current->line->y2);
  +         x1, y1,
  +         x2, y2);
   #endif
   
     /*
  @@ -105,9 +105,8 @@
     else
     color = x_get_color(o_current->color);
   	
  -  if(o_current->screen_line_width > 0) {
  -    line_width = o_current->screen_line_width;
  -  } else {
  +  line_width = SCREENabs( w_current, o_current->line_width );
  +  if( line_width <= 0) {
       line_width = 1;
     }
   	
  @@ -121,8 +120,8 @@
       break;
     }
   
  -  length = o_current->screen_line_length;
  -  space = o_current->screen_line_space;
  +  length = SCREENabs( w_current, o_current->line_length );
  +  space = SCREENabs( w_current, o_current->line_space );
   	
     switch(o_current->line_type) {
       case TYPE_SOLID:
  @@ -778,6 +777,7 @@
   void o_line_draw_xor(TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
   {
     int color;
  +  int sx[2], sy[2];
   
     if (o_current->line == NULL) {
       return;
  @@ -792,11 +792,13 @@
     /* changed for dark color stuff */
     gdk_gc_set_foreground(w_current->outline_xor_gc,
                           x_get_darkcolor(color));
  +  
  +  WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
  +  WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
  +
     gdk_draw_line(w_current->window, w_current->outline_xor_gc,
  -                o_current->line->screen_x[0]+dx,
  -                o_current->line->screen_y[0]+dy,
  -                o_current->line->screen_x[1]+dx,
  -                o_current->line->screen_y[1]+dy);
  +                sx[0]+dx, sy[0]+dy,
  +                sx[1]+dx, sy[1]+dy);
   
     /* backing store? nope not here */
   }
  
  
  
  1.29.6.3  +30 -18    eda/geda/gaf/gschem/src/o_net.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_net.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_net.c,v
  retrieving revision 1.29.6.2
  retrieving revision 1.29.6.3
  diff -u -b -r1.29.6.2 -r1.29.6.3
  --- o_net.c	11 Feb 2007 23:58:57 -0000	1.29.6.2
  +++ o_net.c	12 Feb 2007 02:19:38 -0000	1.29.6.3
  @@ -176,6 +176,7 @@
   {
     int size;
     int color;
  +  int sx[2], sy[2];
   
     if (o_current->line == NULL) {
       return;
  @@ -198,11 +199,13 @@
                                  GDK_JOIN_MITER);
     }
   
  +  WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
  +  WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
  +
     gdk_draw_line(w_current->window, w_current->outline_xor_gc,
  -                o_current->line->screen_x[0]+dx,
  -                o_current->line->screen_y[0]+dy,
  -                o_current->line->screen_x[1]+dx,
  -                o_current->line->screen_y[1]+dy);
  +                sx[0]+dx, sy[0]+dy,
  +                sx[1]+dx, sy[1]+dy);
  +
   
     /* backing store ? not approriate here */
   
  @@ -224,6 +227,7 @@
   {
     int color;
     int dx1 = -1, dx2 = -1, dy1 = -1,dy2 = -1;
  +  int sx[2], sy[2];
   
     if (o_current->line == NULL) {
       return;
  @@ -262,11 +266,12 @@
       fprintf(stderr, _("Got an invalid which one in o_net_draw_xor_single\n"));
     }
   
  +  WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
  +  WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
  +
     gdk_draw_line(w_current->window, w_current->outline_xor_gc,
  -                o_current->line->screen_x[0]+dx1,
  -                o_current->line->screen_y[0]+dy1,
  -                o_current->line->screen_x[1]+dx2,
  -                o_current->line->screen_y[1]+dy2);
  +                sx[0]+dx1, sy[0]+dy1,
  +                sx[1]+dx2, sy[1]+dy2);
   
     /* backing store ? not approriate here */
   
  @@ -411,6 +416,7 @@
     int size;
     int primary_zero_length, secondary_zero_length;
     int found_primary_connection = FALSE;
  +  int sx[2], sy[2];
   
     /*int temp_x, temp_y;*/
     /* OBJECT *o_current;*/
  @@ -542,13 +548,16 @@
         s_conn_print(new_net->conn_list);
   #endif
   
  +      WORLDtoSCREEN( w_current, new_net->line->x[0], new_net->line->y[0], &sx[0], &sy[0] );
  +      WORLDtoSCREEN( w_current, new_net->line->x[1], new_net->line->y[1], &sx[1], &sy[1] );
  +
         gdk_gc_set_foreground(w_current->gc, x_get_color(color));
         gdk_draw_line(w_current->window, w_current->gc,
  -		    new_net->line->screen_x[0], new_net->line->screen_y[0],
  -		    new_net->line->screen_x[1], new_net->line->screen_y[1]);
  +                    sx[0], sy[0],
  +                    sx[1], sy[1]);
         gdk_draw_line(w_current->backingstore, w_current->gc,
  -		    new_net->line->screen_x[0], new_net->line->screen_y[0],
  -		    new_net->line->screen_x[1], new_net->line->screen_y[1]);
  +                    sx[0], sy[0],
  +                    sx[1], sy[1]);
   
         if (w_current->net_style == THICK) {
   	  gdk_gc_set_line_attributes(w_current->gc, 0,
  @@ -602,13 +611,16 @@
         s_conn_print(new_net->conn_list);
   #endif
   
  +      WORLDtoSCREEN( w_current, new_net->line->x[0], new_net->line->y[0], &sx[0], &sy[0] );
  +      WORLDtoSCREEN( w_current, new_net->line->x[1], new_net->line->y[1], &sx[1], &sy[1] );
  +
         gdk_gc_set_foreground(w_current->gc, x_get_color(color));
         gdk_draw_line(w_current->window, w_current->gc,
  -		    new_net->line->screen_x[0], new_net->line->screen_y[0],
  -		    new_net->line->screen_x[1], new_net->line->screen_y[1]);
  +                    sx[0], sy[0],
  +                    sx[1], sy[1]);
         gdk_draw_line(w_current->backingstore, w_current->gc,
  -		    new_net->line->screen_x[0], new_net->line->screen_y[0],
  -		    new_net->line->screen_x[1], new_net->line->screen_y[1]);
  +                    sx[0], sy[0],
  +                    sx[1], sy[1]);
   
         if (w_current->net_style == THICK) {
   	  gdk_gc_set_line_attributes(w_current->gc, 0,
  
  
  
  1.6.6.4   +26 -34    eda/geda/gaf/gschem/src/o_picture.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_picture.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_picture.c,v
  retrieving revision 1.6.6.3
  retrieving revision 1.6.6.4
  diff -u -b -r1.6.6.3 -r1.6.6.4
  --- o_picture.c	12 Feb 2007 02:18:35 -0000	1.6.6.3
  +++ o_picture.c	12 Feb 2007 02:19:38 -0000	1.6.6.4
  @@ -342,6 +342,8 @@
   void o_picture_draw(TOPLEVEL *w_current, OBJECT *o_current)
   {
     int wleft, wright, wtop, wbottom; /* world bounds */
  +  int s_upper_x, s_upper_y, s_lower_x, s_lower_y;
  +
     if (o_current->picture == NULL) {
       return;
     }
  @@ -366,18 +368,18 @@
       return;
     }
   	
  +  WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->upper_y,
  +                 &s_upper_x, &s_upper_y );
  +  WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->lower_y,
  +                 &s_lower_x, &s_lower_y );
  +
   #if  DEBUG 
     printf("drawing picture\n\n");
     
     printf("drawing picture: %d %d %d %d\n",
  -         o_current->picture->screen_upper_x,
  -         o_current->picture->screen_upper_y,
  -         o_current->picture->screen_upper_x +
  -         abs(o_current->picture->screen_lower_x -
  -             o_current->picture->screen_upper_x),
  -         o_current->picture->screen_upper_y +
  -         abs(o_current->picture->screen_lower_y -
  -             o_current->picture->screen_upper_y));
  +         s_upper_x, s_upper_y,
  +         s_upper_x + abs(s_lower_x - s_upper_x),
  +         s_upper_y + abs(s_lower_y - s_upper_y));
   #endif
   
     /*
  @@ -413,10 +415,8 @@
   
       o_current->picture->displayed_picture = 
       gdk_pixbuf_scale_simple(temp_pixbuf2, 
  -                            abs(o_current->picture->screen_lower_x -
  -                                o_current->picture->screen_upper_x), 
  -                            abs(o_current->picture->screen_lower_y - 
  -                                o_current->picture->screen_upper_y), 
  +                            abs(s_lower_x - s_upper_x), 
  +                            abs(s_lower_y - s_upper_y), 
                               GDK_INTERP_BILINEAR);
       g_object_unref(temp_pixbuf2);
   
  @@ -428,13 +428,11 @@
       if (w_current->DONT_REDRAW == 0) {
         gdk_draw_pixbuf(w_current->window, w_current->gc,
   		      o_current->picture->displayed_picture, 
  -		      0, 0, o_current->picture->screen_upper_x,
  -		      o_current->picture->screen_upper_y, 
  +		      0, 0, s_upper_x, s_upper_y, 
   		      -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
         gdk_draw_pixbuf(w_current->backingstore, w_current->gc,
   		      o_current->picture->displayed_picture, 
  -		      0, 0, o_current->picture->screen_upper_x,
  -		      o_current->picture->screen_upper_y, 
  +		      0, 0, s_upper_x, s_upper_y, 
   		      -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
       }
     }
  @@ -444,19 +442,13 @@
         gdk_gc_set_foreground(w_current->gc, 
   			    x_get_color(w_current->background_color));
         gdk_draw_rectangle(w_current->window, w_current->gc, TRUE, 
  -			 o_current->picture->screen_upper_x,
  -			 o_current->picture->screen_upper_y,
  -			 abs(o_current->picture->screen_lower_x -
  -			     o_current->picture->screen_upper_x), 
  -			 abs(o_current->picture->screen_lower_y - 
  -			     o_current->picture->screen_upper_y));
  +			 s_upper_x, s_upper_y,
  +			 abs(s_lower_x - s_upper_x), 
  +			 abs(s_lower_y - s_upper_y));
         gdk_draw_rectangle(w_current->backingstore, w_current->gc, TRUE, 
  -			 o_current->picture->screen_upper_x,
  -			 o_current->picture->screen_upper_y,
  -			 abs(o_current->picture->screen_lower_x -
  -			     o_current->picture->screen_upper_x), 
  -			 abs(o_current->picture->screen_lower_y - 
  -			     o_current->picture->screen_upper_y));
  +			 s_upper_x, s_upper_y,
  +			 abs(s_lower_x -s_upper_x),
  +			 abs(s_lower_y - s_upper_y));
       }
     }
   
  @@ -622,10 +614,10 @@
       return;
     }
   
  -  screen_x1 = o_current->picture->screen_upper_x;
  -  screen_y1 = o_current->picture->screen_upper_y;
  -  screen_x2 = o_current->picture->screen_lower_x;
  -  screen_y2 = o_current->picture->screen_lower_y;
  +  WORLDtoSCREEN( w_current, o_current->picture->upper_x, o_current->picture->upper_y,
  +                 &screen_x1, &screen_y1 );
  +  WORLDtoSCREEN( w_current, o_current->picture->lower_x, o_current->picture->lower_y,
  +                 &screen_x2, &screen_y2 );
   
     if (o_current->saved_color != -1) {
       color = o_current->saved_color;
  
  
  
  1.24.6.1  +6 -4      eda/geda/gaf/gschem/src/o_pin.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_pin.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_pin.c,v
  retrieving revision 1.24
  retrieving revision 1.24.6.1
  diff -u -b -r1.24 -r1.24.6.1
  --- o_pin.c	21 Oct 2006 13:56:26 -0000	1.24
  +++ o_pin.c	12 Feb 2007 02:19:38 -0000	1.24.6.1
  @@ -132,6 +132,7 @@
   {
     int size;
     int color;
  +  int sx[2], sy[2];
   
     if (o_current->line == NULL) {
       return;
  @@ -153,11 +154,12 @@
                                  GDK_JOIN_MITER);
     }
   
  +  WORLDtoSCREEN( w_current, o_current->line->x[0], o_current->line->y[0], &sx[0], &sy[0] );
  +  WORLDtoSCREEN( w_current, o_current->line->x[1], o_current->line->y[1], &sx[1], &sy[1] );
  +
     gdk_draw_line(w_current->window, w_current->xor_gc,
  -                o_current->line->screen_x[0]+dx,
  -                o_current->line->screen_y[0]+dy,
  -                o_current->line->screen_x[1]+dx,
  -                o_current->line->screen_y[1]+dy);
  +                sx[0]+dx, sy[0]+dy,
  +                sx[1]+dx, sy[1]+dy);
   
     if (w_current->pin_style == THICK ) {
       gdk_gc_set_line_attributes(w_current->xor_gc, 0,
  
  
  
  1.5.6.2   +4 -0      eda/geda/gaf/gschem/src/o_select.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_select.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/o_select.c,v
  retrieving revision 1.5.6.1
  retrieving revision 1.5.6.2
  diff -u -b -r1.5.6.1 -r1.5.6.2
  --- o_select.c	27 Dec 2006 17:37:56 -0000	1.5.6.1
  +++ o_select.c	12 Feb 2007 02:19:38 -0000	1.5.6.2
  @@ -388,6 +388,7 @@
     OBJECT *o_current=NULL;
     int count = 0; /* object count */
     int SHIFTKEY = w_current->SHIFTKEY;
  +  int w_start_x, w_start_y, w_last_x, w_last_y;
   	
     int tmp;
   	
  @@ -403,6 +404,9 @@
       w_current->start_y = tmp;
     }
   
  +  SCREENtoWORLD( w_current, w_current->start_x, w_current->start_y, &w_start_x, &w_start_y );
  +  SCREENtoWORLD( w_current, w_current->last_x, w_current->last_y, &w_last_x, &w_last_y );
  +
     o_current = w_current->page_current->object_head;
   
     while (o_current != NULL) {
  
  
  
  1.25.2.3  +6 -8      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.2
  retrieving revision 1.25.2.3
  diff -u -b -r1.25.2.2 -r1.25.2.3
  --- o_text.c	27 Dec 2006 20:01:17 -0000	1.25.2.2
  +++ o_text.c	12 Feb 2007 02:19:38 -0000	1.25.2.3
  @@ -98,8 +98,7 @@
     /* text is too small so go through and draw a rectangle in
        it's place */
   	
  -  screen_x1 = o_current->text->screen_x;
  -  screen_y1 = o_current->text->screen_y;
  +  WORLDtoSCREEN( w_current, o_current->text->x, o_current->text->y, &screen_x1, &screen_y1 );
   
     if (w_current->override_color != -1 ) {  /* Override */
       color = x_get_color(w_current->override_color);
  @@ -233,8 +232,9 @@
   
         offset = SCREENabs(w_current, 10);
         small_dist = SCREENabs(w_current, 20);
  -      screen_x1 = o_current->text->screen_x + offset;
  -      screen_y1 = o_current->text->screen_y + offset;
  +      WORLDtoSCREEN( w_current, o_current->text->x, o_current->text->y, &screen_x1, &screen_y1 );
  +      screen_x1 += offset;
  +      screen_y1 += offset;
         if (w_current->DONT_REDRAW == 0) {
   	/* Top part of the I */
   	gdk_draw_line(w_current->window, w_current->gc,
  @@ -286,8 +286,7 @@
   
     small_dist = SCREENabs(w_current, 10);
   
  -  screen_x1 = o_current->text->screen_x;
  -  screen_y1 = o_current->text->screen_y;
  +  WORLDtoSCREEN( w_current, o_current->text->x, o_current->text->y, &screen_x1, &screen_y1 );
   
     /* this is not really a fix, but a lame patch */
     /* not having this will cause a bad draw of things when coords */
  @@ -367,8 +366,7 @@
       /* text is too small so go through and draw a line in
          it's place */
   
  -    screen_x1 = o_current->text->screen_x;
  -    screen_y1 = o_current->text->screen_y;
  +    WORLDtoSCREEN( w_current, o_current->text->x, o_current->text->y, &screen_x1, &screen_y1 );
   
       if (o_current->saved_color != -1) {
         color = o_current->saved_color;
  
  
  


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