[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: x_image.nw
User: cnieves
Date: 05/10/15 11:26:36
Modified: . x_image.nw
Log:
Remove the grid when exporting to PNG. Reorganize and comment some code.
Revision Changes Path
1.17 +23 -14 eda/geda/devel/gschem/noweb/x_image.nw
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_image.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/x_image.nw,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- x_image.nw 15 Oct 2005 01:06:47 -0000 1.16
+++ x_image.nw 15 Oct 2005 15:26:36 -0000 1.17
@@ -699,22 +699,26 @@
toplevel.window = gdk_pixmap_new(w_current->window, size_x, size_y, -1);
toplevel.backingstore = gdk_pixmap_new(w_current->window, size_x, size_y, -1);
+ toplevel.grid = 0;
+
+ origin_x = origin_y = 0;
+ right = size_x;
+ bottom = size_y;
+ /* ------------------ Begin optional code ------------------------ */
+ /* If the the code in this region is commented, the PNG returned will
+ be the same as the one returned using libgdgeda.
+ I mean: there will be some border all around the schematic.
+ This code is used to adjust the schematic to the border of the image */
+
/* Do a zoom extents to get fit all the schematic in the window */
+ /* Commented so the image returned will be the same as with libgdgeda */
a_zoom_extents (&toplevel,
toplevel.page_current->object_head,
A_PAN_DONT_REDRAW);
- o_redraw_all(&toplevel);
-
- get_complex_bounds(&toplevel,
- toplevel.page_current->object_head,
- &origin_x, &origin_y,
- &right, &bottom);
-
- o_redraw_all (&toplevel);
-
/* See if there are objects */
+
aux = w_current->page_current->object_head;
while (aux != NULL) {
if (aux->type != -1) {
@@ -725,11 +729,16 @@
}
/* If there are no objects, can't use zoom_extents */
- if (!object_found) {
- origin_x = origin_y = 0;
- right = size_x;
- bottom = size_y;
+ if (object_found) {
+ o_redraw_all (&toplevel);
+ get_complex_bounds(&toplevel,
+ toplevel.page_current->object_head,
+ &origin_x, &origin_y,
+ &right, &bottom);
}
+ /* ------------------ End optional code ------------------------ */
+
+ o_redraw_all (&toplevel);
/* Get the pixbuf */
pixbuf=gdk_pixbuf_get_from_drawable(NULL,toplevel.backingstore, NULL,