Bug 564087 – Using clone tool on a layer with a part out of canvas

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.


svn path=/trunk/; revision=27835
This commit is contained in:
Sven Neumann 2008-12-27 16:04:43 +00:00 committed by Sven Neumann
parent c03759344b
commit a4daf7f210
2 changed files with 25 additions and 6 deletions

View File

@ -1,3 +1,11 @@
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.
2008-12-27 Sven Neumann <sven@gimp.org>
* app/base/pixel-surround.c (struct _PixelSurround): formatting.

View File

@ -22,6 +22,8 @@
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
#include "paint-types.h"
#include "base/pixel-region.h"
@ -804,15 +806,24 @@ gimp_paint_core_paste (GimpPaintCore *core,
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: