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

gEDA-cvs: CVS update: o_arc_basic.c



  User: pcjc2   
  Date: 07/02/25 08:21:22

  Modified:    .        Tag: noscreen o_arc_basic.c o_box_basic.c
                        o_bus_basic.c o_circle_basic.c o_line_basic.c
                        o_net_basic.c o_pin_basic.c
  Log:
  Modified PNG export routines to calculate directly from object world coords.
  
  
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.31.2.6  +3 -5      eda/geda/gaf/libgeda/src/o_arc_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_arc_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_arc_basic.c,v
  retrieving revision 1.31.2.5
  retrieving revision 1.31.2.6
  diff -u -b -r1.31.2.5 -r1.31.2.6
  --- o_arc_basic.c	12 Feb 2007 02:20:24 -0000	1.31.2.5
  +++ o_arc_basic.c	25 Feb 2007 13:21:12 -0000	1.31.2.6
  @@ -1492,11 +1492,9 @@
     if (end_angle < start_angle)
       end_angle += 360;
   
  -  width  = o_current->arc->screen_width;
  -  height = o_current->arc->screen_height;
  -
  -  x = o_current->arc->screen_x;
  -  y = o_current->arc->screen_y;
  +  width = SCREENabs( w_current, o_current->arc->width);
  +  height = SCREENabs( w_current, o_current->arc->height);
  +  WORLDtoSCREEN( w_current, o_current->arc->x, o_current->arc->y, &x, &y );
   	
   #ifdef HAS_LIBGD
   
  
  
  
  1.26.2.5  +12 -7     eda/geda/gaf/libgeda/src/o_box_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_box_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_box_basic.c,v
  retrieving revision 1.26.2.4
  retrieving revision 1.26.2.5
  diff -u -b -r1.26.2.4 -r1.26.2.5
  --- o_box_basic.c	12 Feb 2007 02:20:24 -0000	1.26.2.4
  +++ o_box_basic.c	25 Feb 2007 13:21:14 -0000	1.26.2.5
  @@ -1567,7 +1567,7 @@
   		       int origin_x, int origin_y, int color_mode)
   {
     int color;
  -
  +  int s_upper_x, s_upper_y, s_lower_x, s_lower_y;
   
     if (o_current == NULL) {
       printf("got null in o_box_image_write\n");
  @@ -1581,18 +1581,23 @@
       color = image_black;
     }
   
  -  /* assumes screen coords are already calculated correctly */
   #ifdef HAS_LIBGD
   
  +  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);
  +
     gdImageSetThickness(current_im_ptr, SCREENabs(w_current,
                                                   o_current->line_width));
   
     gdImageRectangle(current_im_ptr, 
  -                   o_current->box->screen_upper_x,
  -                   o_current->box->screen_upper_y,
  -                   o_current->box->screen_lower_x,
  -                   o_current->box->screen_lower_y, 
  +                   s_upper_x, s_upper_y,
  +                   s_lower_x, s_lower_y,
                      color);
   #endif
  -
   }
  
  
  
  1.17.2.4  +11 -26    eda/geda/gaf/libgeda/src/o_bus_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_bus_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_bus_basic.c,v
  retrieving revision 1.17.2.3
  retrieving revision 1.17.2.4
  diff -u -b -r1.17.2.3 -r1.17.2.4
  --- o_bus_basic.c	27 Dec 2006 20:30:51 -0000	1.17.2.3
  +++ o_bus_basic.c	25 Feb 2007 13:21:16 -0000	1.17.2.4
  @@ -437,10 +437,7 @@
   void o_bus_image_write(TOPLEVEL *w_current, OBJECT *o_current,
   		       int origin_x, int origin_y, int color_mode)
   {
  -  int offset, offset2;
  -  int cross;
  -  int x1, y1;
  -  int x2, y2;
  +  int x[2], y[2];
     int color;
   
     if (o_current == NULL) {
  @@ -454,34 +451,22 @@
       color = image_black;
     }
   
  -  offset = SCREENabs(w_current, BUS_WIDTH);
  -
  -  /* 
  -     offset = 7 * (float) w_current->height/ (float) w_current->width;
  -     offset2 = 7 * (float) w_current->height/ (float) w_current->width*2;  
  -
  -     printf("%f %d %d\n", (float) ( (float) w_current->height/ (float) w_current->width), 
  -     offset, offset2);
  -  */
  -
  -  offset2 = offset*2;
  -
  -  cross = offset;
  -
  -  x1 = o_current->line->screen_x[0];
  -  y1 = o_current->line->screen_y[0];
  -  x2 = o_current->line->screen_x[1];
  -  y2 = o_current->line->screen_y[1];
  -
  -  /* assumes screen coords are already calculated correctly */
   #ifdef HAS_LIBGD
   
  +  WORLDtoSCREEN(w_current,
  +                o_current->line->x[0],
  +                o_current->line->y[0],
  +                &x[0], &y[0]);
  +  WORLDtoSCREEN(w_current,
  +                o_current->line->x[1],
  +                o_current->line->y[1],
  +                &x[1], &y[1]);
  +
     gdImageSetThickness(current_im_ptr, SCREENabs(w_current, BUS_WIDTH));
   
  -  gdImageLine(current_im_ptr, x1, y1, x2, y2, color);
  +  gdImageLine(current_im_ptr, x[0], y[0], x[1], y[1], color);
   
   #endif
  -
   }
   
   
  
  
  
  1.27.2.5  +11 -4     eda/geda/gaf/libgeda/src/o_circle_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_circle_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_circle_basic.c,v
  retrieving revision 1.27.2.4
  retrieving revision 1.27.2.5
  diff -u -b -r1.27.2.4 -r1.27.2.5
  --- o_circle_basic.c	12 Feb 2007 02:20:24 -0000	1.27.2.4
  +++ o_circle_basic.c	25 Feb 2007 13:21:16 -0000	1.27.2.5
  @@ -1294,6 +1294,8 @@
   void o_circle_image_write(TOPLEVEL *w_current, OBJECT *o_current,
   			  int origin_x, int origin_y, int color_mode)
   {
  +  int diameter;
  +  int s_x, s_y;
     int color;
   
     if (o_current == NULL) {
  @@ -1309,14 +1311,19 @@
   
   #ifdef HAS_LIBGD
   
  +  diameter = SCREENabs(w_current, o_current->circle->radius)*2;
  +  WORLDtoSCREEN(w_current,
  +                o_current->circle->center_x,
  +                o_current->circle->center_y,
  +                &s_x, &s_y);
  +
     gdImageSetThickness(current_im_ptr, SCREENabs(w_current,
                                                   o_current->line_width));
   
     gdImageArc(current_im_ptr, 
  -             o_current->circle->screen_x, 
  -             o_current->circle->screen_y,
  -             SCREENabs(w_current, o_current->circle->radius)*2,
  -             SCREENabs(w_current, o_current->circle->radius)*2,
  +             s_x, s_y,
  +             diameter,
  +             diameter,
                0, 360, 
                color);
   #endif
  
  
  
  1.26.2.5  +12 -5     eda/geda/gaf/libgeda/src/o_line_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_line_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_line_basic.c,v
  retrieving revision 1.26.2.4
  retrieving revision 1.26.2.5
  diff -u -b -r1.26.2.4 -r1.26.2.5
  --- o_line_basic.c	12 Feb 2007 02:20:24 -0000	1.26.2.4
  +++ o_line_basic.c	25 Feb 2007 13:21:17 -0000	1.26.2.5
  @@ -1313,6 +1313,7 @@
   void o_line_image_write(TOPLEVEL *w_current, OBJECT *o_current, 
   			int origin_x, int origin_y, int color_mode)
   {
  +  int x[2], y[2];
     int color;
   
     if (o_current == NULL) {
  @@ -1326,17 +1327,23 @@
       color = image_black;
     }
   
  -  /* assumes screen coords are already calculated correctly */
   #ifdef HAS_LIBGD
   
  +  WORLDtoSCREEN(w_current,
  +                o_current->line->x[0],
  +                o_current->line->y[0],
  +                &x[0], &y[0]);
  +  WORLDtoSCREEN(w_current,
  +                o_current->line->x[1],
  +                o_current->line->y[1],
  +                &x[1], &y[1]);
  +
     gdImageSetThickness(current_im_ptr, SCREENabs(w_current, 
   					        o_current->line_width));
   
     gdImageLine(current_im_ptr, 
  -              o_current->line->screen_x[0],
  -              o_current->line->screen_y[0],
  -              o_current->line->screen_x[1],
  -              o_current->line->screen_y[1], 
  +              x[0], y[0],
  +              x[1], y[1],
                 color);
   #endif
   }
  
  
  
  1.34.2.4  +10 -34    eda/geda/gaf/libgeda/src/o_net_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_net_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_net_basic.c,v
  retrieving revision 1.34.2.3
  retrieving revision 1.34.2.4
  diff -u -b -r1.34.2.3 -r1.34.2.4
  --- o_net_basic.c	27 Dec 2006 20:30:51 -0000	1.34.2.3
  +++ o_net_basic.c	25 Feb 2007 13:21:17 -0000	1.34.2.4
  @@ -464,11 +464,7 @@
   void o_net_image_write(TOPLEVEL *w_current, OBJECT *o_current,
   		       int origin_x, int origin_y, int color_mode)
   {
  -  int offset, offset2;
  -  int cross;
  -  int x1, y1;
  -  int x2, y2;
  -  int endpoint_color;
  +  int x[2], y[2];
     int color;
   
     if (o_current == NULL) {
  @@ -482,27 +478,15 @@
       color = image_black;
     }
   
  -  offset = SCREENabs(w_current, NET_WIDTH);
  -
  -  /* 
  -     offset = 7 * (float) w_current->height/ (float) w_current->width;
  -     offset2 = 7 * (float) w_current->height/ (float) w_current->width*2;  
  -
  -     printf("%f %d %d\n", (float) ( (float) w_current->height/ (float) w_current->width), 
  -     offset, offset2);
  -  */
  -
  -  offset2 = offset * 2;
  -
  -  cross = offset;
  -
  -  x1 = o_current->line->screen_x[0];
  -  y1 = o_current->line->screen_y[0];
  -  x2 = o_current->line->screen_x[1];
  -  y2 = o_current->line->screen_y[1];
  -
  -  /* assumes screen coords are already calculated correctly */
   #ifdef HAS_LIBGD
  +  WORLDtoSCREEN(w_current,
  +                o_current->line->x[0],
  +                o_current->line->y[0],
  +                &x[0], &y[0]);
  +  WORLDtoSCREEN(w_current,
  +                o_current->line->x[1],
  +                o_current->line->y[1],
  +                &x[1], &y[1]);
   
     if (w_current->net_style == THICK) {
       gdImageSetThickness(current_im_ptr, SCREENabs(w_current,
  @@ -511,16 +495,8 @@
       gdImageSetThickness(current_im_ptr, 0);
     }
   
  -  gdImageLine(current_im_ptr, x1, y1, x2, y2, color);
  +  gdImageLine(current_im_ptr, x[0], y[0], x[1], y[1], color);
   #endif
  -
  -  if (color_mode == TRUE) {
  -    endpoint_color =
  -      o_image_geda2gd_color(w_current->net_endpoint_color);
  -  } else {
  -    endpoint_color = image_black;
  -  }
  -
   }
   
   /*! \todo Finish function documentation!!!
  
  
  
  1.24.2.4  +11 -5     eda/geda/gaf/libgeda/src/o_pin_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_pin_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_pin_basic.c,v
  retrieving revision 1.24.2.3
  retrieving revision 1.24.2.4
  diff -u -b -r1.24.2.3 -r1.24.2.4
  --- o_pin_basic.c	27 Dec 2006 20:30:51 -0000	1.24.2.3
  +++ o_pin_basic.c	25 Feb 2007 13:21:18 -0000	1.24.2.4
  @@ -454,6 +454,7 @@
   void o_pin_image_write(TOPLEVEL *w_current, OBJECT *o_current,
   		       int origin_x, int origin_y, int color_mode)
   {
  +  int x[2], y[2];
     int color;
   
     if (o_current == NULL) {
  @@ -467,8 +468,15 @@
       color = image_black;
     }
   
  -  /* assumes screen coords are already calculated correctly */
   #ifdef HAS_LIBGD
  +  WORLDtoSCREEN(w_current,
  +                o_current->line->x[0],
  +                o_current->line->y[0],
  +                &x[0], &y[0]);
  +  WORLDtoSCREEN(w_current,
  +                o_current->line->x[1],
  +                o_current->line->y[1],
  +                &x[1], &y[1]);
   
     if (w_current->pin_style == THICK) {
       gdImageSetThickness(current_im_ptr, SCREENabs(w_current,
  @@ -478,10 +486,8 @@
     }
   
     gdImageLine(current_im_ptr,
  -              o_current->line->screen_x[0],
  -              o_current->line->screen_y[0],
  -              o_current->line->screen_x[1],
  -              o_current->line->screen_y[1],
  +              x[0], y[0],
  +              x[1], y[1],
                 color);
   #endif
   }
  
  
  


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