On Tue, 2008-12-23 at 07:36 -0500, Ales Hvezda wrote:
> [snip]
> >> Sorry! I'll try to have it working again ASAP.
> >
> >Now fixed. Shame that taints 1.5.1 though.
> 
>       I don't really want to respin 1.5.1, since there are already
> changes on master which I don't want to pick up, but...

No, once its out, its out.. a respin would be 1.5.1.1, or 1.5.2.

>       I could just put a patch in the release/v1.5/1.5.1 dir with 
> the fix.  That way people can apply it if they need the png export.

That's a good idea. When we get release-notes, we can mention the patch
I guess, as a known erratum.

I've attached the required patch.

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
>From 9d2dea918ee72b474e11962adbd9ca6167162c14 Mon Sep 17 00:00:00 2001
From: Peter Clifton <[email protected]>
Date: Mon, 22 Dec 2008 21:02:48 +0000
Subject: [PATCH] gschem: Fix PNG export broken by invalidate/expose drawing model changes

We need to explicitly redraw the objects to form the image, we can't
use o_invalidate_all() as that only works for drawing to the screen.
---
 gschem/src/x_image.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/gschem/src/x_image.c b/gschem/src/x_image.c
index 3c3f776..696247f 100644
--- a/gschem/src/x_image.c
+++ b/gschem/src/x_image.c
@@ -629,6 +629,7 @@ GdkPixbuf *x_image_get_pixbuf (GSCHEM_TOPLEVEL *w_current)
   int size_x, size_y, s_right, s_left, s_top,s_bottom;
   GSCHEM_TOPLEVEL new_w_current;
   TOPLEVEL toplevel;
+  GdkRectangle rect;
 
   /* Do a copy of the w_current struct and work with it */
   memcpy(&new_w_current, w_current, sizeof(GSCHEM_TOPLEVEL));
@@ -655,7 +656,7 @@ GdkPixbuf *x_image_get_pixbuf (GSCHEM_TOPLEVEL *w_current)
   size_y = new_w_current.image_height;
 
   new_w_current.window = gdk_pixmap_new (w_current->window, size_x, size_y, -1);
-  new_w_current.drawable = gdk_pixmap_new (w_current->window, size_x, size_y, -1);
+  new_w_current.drawable = new_w_current.window;
   new_w_current.grid = 0;
   new_w_current.text_origin_marker = FALSE;
 
@@ -708,7 +709,6 @@ GdkPixbuf *x_image_get_pixbuf (GSCHEM_TOPLEVEL *w_current)
   
   /* If there are no objects, can't use zoom_extents */
   if (object_found) {
-    o_invalidate_all (&toplevel);
     get_object_glist_bounds (&toplevel,
                              toplevel.page_current->object_list,
                              &origin_x, &origin_y,
@@ -717,7 +717,12 @@ GdkPixbuf *x_image_get_pixbuf (GSCHEM_TOPLEVEL *w_current)
 #endif
   /* ------------------  End optional code ------------------------ */
   
-  o_invalidate_all (&new_w_current);
+  rect.x = origin_x;
+  rect.y = origin_y;
+  rect.width = right - origin_x;
+  rect.height = bottom - origin_y;
+
+  o_redraw_rects (&new_w_current, &rect, 1);
 
   /* Get the pixbuf */
   pixbuf = gdk_pixbuf_get_from_drawable (NULL,new_w_current.drawable, NULL,
@@ -733,9 +738,6 @@ GdkPixbuf *x_image_get_pixbuf (GSCHEM_TOPLEVEL *w_current)
   if (new_w_current.window != NULL) {
     g_object_unref(new_w_current.window);
   }
-  if (new_w_current.drawable != NULL) {
-    g_object_unref (new_w_current.drawable);
-  }
 
   return(pixbuf);
 }
-- 
1.6.0.4


_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to