Commit a4daf7f2 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

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
parent c0375934
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.
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment