goffice r2322 - in trunk: . goffice/cut-n-paste/foocanvas



Author: mortenw
Date: Thu Feb 26 23:52:55 2009
New Revision: 2322
URL: http://svn.gnome.org/viewvc/goffice?rev=2322&view=rev

Log:
2009-02-26  Morten Welinder  <terra gnome org>

	* goffice/cut-n-paste/foocanvas/foo-canvas-pixbuf.c (foo_canvas_pixbuf_update):
	If the resulting size is 0 pixels, don't try to scale the pixbuf.
	Avoids critical on image insert in Gnumeric.



Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/goffice/cut-n-paste/foocanvas/foo-canvas-pixbuf.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Thu Feb 26 23:52:55 2009
@@ -1,5 +1,8 @@
 goffice 0.7.4:
 
+Morten:
+	* Fix a pixbuf scaling problem in foocanvas.
+
 --------------------------------------------------------------------------
 goffice 0.7.3:
 

Modified: trunk/goffice/cut-n-paste/foocanvas/foo-canvas-pixbuf.c
==============================================================================
--- trunk/goffice/cut-n-paste/foocanvas/foo-canvas-pixbuf.c	(original)
+++ trunk/goffice/cut-n-paste/foocanvas/foo-canvas-pixbuf.c	Thu Feb 26 23:52:55 2009
@@ -671,8 +671,10 @@
 
 			if (priv->pixbuf_scaled)
 				g_object_unref (priv->pixbuf_scaled);
-			if (gdk_pixbuf_get_width (priv->pixbuf) != w ||
-			    gdk_pixbuf_get_height (priv->pixbuf) != h)
+			if (w <= 0 || h <= 0)
+				priv->pixbuf_scaled = NULL;
+			else if (gdk_pixbuf_get_width (priv->pixbuf) != w ||
+				 gdk_pixbuf_get_height (priv->pixbuf) != h)
 				priv->pixbuf_scaled = gdk_pixbuf_scale_simple (
 					priv->pixbuf, w, h, priv->interp_type);
 			else



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