gimp r27835 - in trunk: . app/paint



Author: neo
Date: Sat Dec 27 16:04:43 2008
New Revision: 27835
URL: http://svn.gnome.org/viewvc/gimp?rev=27835&view=rev

Log:
2008-12-27  Sven Neumann  <sven gimp org>

        Bug 564087 â Using clone tool on a layer with a part out of 
canvas
        causes crashes

        * app/paint/gimppaintcore.c (gimp_paint_core_paste): intersect 
the
        rectangle with the extents of the saved projection.



Modified:
   trunk/ChangeLog
   trunk/app/paint/gimppaintcore.c

Modified: trunk/app/paint/gimppaintcore.c
==============================================================================
--- trunk/app/paint/gimppaintcore.c	(original)
+++ trunk/app/paint/gimppaintcore.c	Sat Dec 27 16:04:43 2008
@@ -22,6 +22,8 @@
 
 #include <gegl.h>
 
+#include "libgimpbase/gimpbase.h"
+
 #include "paint-types.h"
 
 #include "base/pixel-region.h"
@@ -804,15 +806,24 @@
       GimpProjection *projection = gimp_image_get_projection (image);
       gint            off_x;
       gint            off_y;
+      gint            x, y;
+      gint            w, h;
 
       gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
 
-      gimp_paint_core_validate_saved_proj_tiles (core,
-                                                 GIMP_PICKABLE (projection),
-                                                 core->canvas_buf->x + off_x,
-                                                 core->canvas_buf->y + off_y,
-                                                 core->canvas_buf->width,
-                                                 core->canvas_buf->height);
+      if (gimp_rectangle_intersect (core->canvas_buf->x + off_x,
+                                    core->canvas_buf->y + off_y,
+                                    core->canvas_buf->width,
+                                    core->canvas_buf->height,
+                                    0, 0,
+                                    tile_manager_width (core->saved_proj_tiles),
+                                    tile_manager_height (core->saved_proj_tiles),
+                                    &x, &y, &w, &h))
+        {
+          gimp_paint_core_validate_saved_proj_tiles (core,
+                                                     GIMP_PICKABLE (projection),
+                                                     x, y, w, h);
+        }
     }
 
   /*  If the mode is CONSTANT:



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