dia r3972 - in trunk: . lib



Author: hans
Date: Mon Apr 28 20:33:42 2008
New Revision: 3972
URL: http://svn.gnome.org/viewvc/dia?rev=3972&view=rev

Log:
2008-04-28  Hans Breuer  <hans breuer org>

	* lib/diagdkrenderer.c : another cheap optimization, clip the
	requested sub-pixbuf to the visible area



Modified:
   trunk/ChangeLog
   trunk/lib/diagdkrenderer.c

Modified: trunk/lib/diagdkrenderer.c
==============================================================================
--- trunk/lib/diagdkrenderer.c	(original)
+++ trunk/lib/diagdkrenderer.c	Mon Apr 28 20:33:42 2008
@@ -820,6 +820,12 @@
       int sub_width = real_width - (real_x >= 0 ? 0 : -real_x);
       int sub_height = real_height - (real_y >= 0 ? 0 : -real_y);
 
+      /* we can also clip to our pixmap size */
+      if (get_width_pixels (object) < sub_width)
+	sub_width = get_width_pixels (object);
+      if (get_height_pixels (object) < sub_height)
+	sub_height = get_height_pixels (object);
+
       if (sub_height > 0 && sub_width > 0) {
         GdkPixbuf *scaled = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (org),
                                             gdk_pixbuf_get_has_alpha (org),



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