app/core/gimp-edit.c app/core/gimpchannel.c

2008-11-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimp-edit.c
	* app/core/gimpchannel.c
	* app/core/gimpdrawable-transform.c
	* app/core/gimpdrawable.c
	* app/core/gimpdrawablemodundo.c
	* app/core/gimplayer.c
	* app/core/gimplayermask.c
	* app/core/gimpselection.c
	* app/text/gimptext-compat.c
	* app/text/gimptextlayer-xcf.c
	* app/vectors/gimpvectorsmodundo.c
	* app/widgets/gimpviewrendererdrawable.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/layer.pdb: use accessors for item->offset_x,y.
	Some minor unrelated cleanups.

	* app/pdb/layer-cmds.c: regenerated.


svn path=/trunk/; revision=27537
This commit is contained in:
Michael Natterer 2008-11-03 21:17:50 +00:00 committed by Michael Natterer
parent 50f8d85ca3
commit b994ab724e
17 changed files with 155 additions and 95 deletions

View File

@ -1,3 +1,24 @@
2008-11-03 Michael Natterer <mitch@gimp.org>
* app/core/gimp-edit.c
* app/core/gimpchannel.c
* app/core/gimpdrawable-transform.c
* app/core/gimpdrawable.c
* app/core/gimpdrawablemodundo.c
* app/core/gimplayer.c
* app/core/gimplayermask.c
* app/core/gimpselection.c
* app/text/gimptext-compat.c
* app/text/gimptextlayer-xcf.c
* app/vectors/gimpvectorsmodundo.c
* app/widgets/gimpviewrendererdrawable.c
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c
* tools/pdbgen/pdb/layer.pdb: use accessors for item->offset_x,y.
Some minor unrelated cleanups.
* app/pdb/layer-cmds.c: regenerated.
2008-11-03 Michael Natterer <mitch@gimp.org>
* app/actions/vectors-actions.c: include "gimpcontainer.h".

View File

@ -254,8 +254,7 @@ gimp_edit_paste (GimpImage *image,
offset_x = MAX (offset_x, 0);
offset_y = MAX (offset_y, 0);
GIMP_ITEM (layer)->offset_x = offset_x;
GIMP_ITEM (layer)->offset_y = offset_y;
gimp_item_set_offset (GIMP_ITEM (layer), offset_x, offset_y);
/* Start a group undo */
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,

View File

@ -431,7 +431,7 @@ gimp_channel_convert (GimpItem *item,
if (gimp_drawable_has_alpha (drawable))
new_type = GIMP_IMAGE_TYPE_WITH_ALPHA (new_type);
new_tiles = tile_manager_new (gimp_item_get_width (item),
new_tiles = tile_manager_new (gimp_item_get_width (item),
gimp_item_get_height (item),
GIMP_IMAGE_TYPE_BYTES (new_type));
@ -455,7 +455,7 @@ gimp_channel_convert (GimpItem *item,
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
0, 0,
gimp_item_get_width (item),
gimp_item_get_width (item),
gimp_item_get_height (item),
FALSE);
pixel_region_init (&destPR, new_tiles,
@ -478,8 +478,7 @@ gimp_channel_convert (GimpItem *item,
gint width = gimp_image_get_width (dest_image);
gint height = gimp_image_get_height (dest_image);
item->offset_x = 0;
item->offset_y = 0;
gimp_item_set_offset (item, 0, 0);
if (gimp_item_get_width (item) != width ||
gimp_item_get_height (item) != height)
@ -640,8 +639,7 @@ gimp_channel_resize (GimpItem *item,
if (G_TYPE_FROM_INSTANCE (item) == GIMP_TYPE_CHANNEL)
{
item->offset_x = 0;
item->offset_y = 0;
gimp_item_set_offset (item, 0, 0);
}
}

View File

@ -856,8 +856,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable,
_("Transformation"),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);
GIMP_ITEM (layer)->offset_x = offset_x;
GIMP_ITEM (layer)->offset_y = offset_y;
gimp_item_set_offset (GIMP_ITEM (layer), offset_x, offset_y);
floating_sel_attach (layer, drawable);
}

View File

@ -379,11 +379,15 @@ gimp_drawable_duplicate (GimpItem *item,
GimpDrawable *new_drawable = GIMP_DRAWABLE (new_item);
PixelRegion srcPR;
PixelRegion destPR;
gint offset_x;
gint offset_y;
gimp_item_get_offset (item, &offset_x, &offset_y);
gimp_drawable_configure (new_drawable,
gimp_item_get_image (item),
item->offset_x,
item->offset_y,
offset_x,
offset_y,
gimp_item_get_width (item),
gimp_item_get_height (item),
gimp_drawable_type (drawable),
@ -1088,8 +1092,8 @@ gimp_drawable_set_tiles_full (GimpDrawable *drawable,
if (gimp_item_get_width (item) != tile_manager_width (tiles) ||
gimp_item_get_height (item) != tile_manager_height (tiles) ||
item->offset_x != offset_x ||
item->offset_y != offset_y)
item->offset_x != offset_x ||
item->offset_y != offset_y)
{
gimp_drawable_update (drawable,
0, 0,

View File

@ -85,10 +85,12 @@ gimp_drawable_mod_undo_constructor (GType type,
drawable = GIMP_DRAWABLE (GIMP_ITEM_UNDO (object)->item);
drawable_mod_undo->tiles = tile_manager_ref (gimp_drawable_get_tiles (drawable));
drawable_mod_undo->type = drawable->type;
drawable_mod_undo->offset_x = GIMP_ITEM (drawable)->offset_x;
drawable_mod_undo->offset_y = GIMP_ITEM (drawable)->offset_y;
drawable_mod_undo->tiles = tile_manager_ref (gimp_drawable_get_tiles (drawable));
drawable_mod_undo->type = gimp_drawable_type (drawable);
gimp_item_get_offset (GIMP_ITEM (drawable),
&drawable_mod_undo->offset_x,
&drawable_mod_undo->offset_y);
return object;
}
@ -115,7 +117,8 @@ gimp_drawable_mod_undo_pop (GimpUndo *undo,
GimpDrawable *drawable = GIMP_DRAWABLE (GIMP_ITEM_UNDO (undo)->item);
TileManager *tiles;
GimpImageType type;
gint offset_x, offset_y;
gint offset_x;
gint offset_y;
GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);
@ -124,10 +127,12 @@ gimp_drawable_mod_undo_pop (GimpUndo *undo,
offset_x = drawable_mod_undo->offset_x;
offset_y = drawable_mod_undo->offset_y;
drawable_mod_undo->tiles = tile_manager_ref (gimp_drawable_get_tiles (drawable));
drawable_mod_undo->type = drawable->type;
drawable_mod_undo->offset_x = GIMP_ITEM (drawable)->offset_x;
drawable_mod_undo->offset_y = GIMP_ITEM (drawable)->offset_y;
drawable_mod_undo->tiles = tile_manager_ref (gimp_drawable_get_tiles (drawable));
drawable_mod_undo->type = drawable->type;
gimp_item_get_offset (GIMP_ITEM (drawable),
&drawable_mod_undo->offset_x,
&drawable_mod_undo->offset_y);
gimp_drawable_set_tiles_full (drawable, FALSE, NULL,
tiles, type, offset_x, offset_y);

View File

@ -766,8 +766,10 @@ gimp_layer_translate (GimpItem *item,
if (layer->mask)
{
GIMP_ITEM (layer->mask)->offset_x = item->offset_x;
GIMP_ITEM (layer->mask)->offset_y = item->offset_y;
gint off_x, off_y;
gimp_item_get_offset (item, &off_x, &off_y);
gimp_item_set_offset (GIMP_ITEM (layer->mask), off_x, off_y);
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (layer->mask));
}
@ -1496,6 +1498,7 @@ gimp_layer_create_mask (const GimpLayer *layer,
case GIMP_ADD_CHANNEL_MASK:
{
gboolean channel_empty;
gint offset_x, offset_y;
gint copy_x, copy_y;
gint copy_width, copy_height;
@ -1504,10 +1507,12 @@ gimp_layer_create_mask (const GimpLayer *layer,
channel_empty = gimp_channel_is_empty (channel);
gimp_item_get_offset (item, &offset_x, &offset_y);
gimp_rectangle_intersect (0, 0,
gimp_image_get_width (image),
gimp_image_get_height (image),
item->offset_x, item->offset_y,
offset_x, offset_y,
gimp_item_get_width (item),
gimp_item_get_height (item),
&copy_x, &copy_y,
@ -1527,7 +1532,7 @@ gimp_layer_create_mask (const GimpLayer *layer,
FALSE);
pixel_region_init (&destPR,
gimp_drawable_get_tiles (GIMP_DRAWABLE (mask)),
copy_x - item->offset_x, copy_y - item->offset_y,
copy_x - offset_x, copy_y - offset_y,
copy_width, copy_height,
TRUE);
@ -1709,6 +1714,7 @@ void
gimp_layer_add_alpha (GimpLayer *layer)
{
GimpItem *item;
GimpDrawable *drawable;
PixelRegion srcPR, destPR;
TileManager *new_tiles;
GimpImageType new_type;
@ -1718,9 +1724,10 @@ gimp_layer_add_alpha (GimpLayer *layer)
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
return;
item = GIMP_ITEM (layer);
item = GIMP_ITEM (layer);
drawable = GIMP_DRAWABLE (layer);
new_type = gimp_drawable_type_with_alpha (GIMP_DRAWABLE (layer));
new_type = gimp_drawable_type_with_alpha (drawable);
/* Allocate the new tiles */
new_tiles = tile_manager_new (gimp_item_get_width (item),
@ -1728,7 +1735,7 @@ gimp_layer_add_alpha (GimpLayer *layer)
GIMP_IMAGE_TYPE_BYTES (new_type));
/* Configure the pixel regions */
pixel_region_init (&srcPR, gimp_drawable_get_tiles (GIMP_DRAWABLE (layer)),
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item),
@ -1755,6 +1762,7 @@ gimp_layer_flatten (GimpLayer *layer,
GimpContext *context)
{
GimpItem *item;
GimpDrawable *drawable;
PixelRegion srcPR, destPR;
TileManager *new_tiles;
GimpImageType new_type;
@ -1766,12 +1774,13 @@ gimp_layer_flatten (GimpLayer *layer,
if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
return;
item = GIMP_ITEM (layer);
item = GIMP_ITEM (layer);
drawable = GIMP_DRAWABLE (layer);
new_type = gimp_drawable_type_without_alpha (GIMP_DRAWABLE (layer));
new_type = gimp_drawable_type_without_alpha (drawable);
gimp_image_get_background (gimp_item_get_image (GIMP_ITEM (layer)), context,
gimp_drawable_type (GIMP_DRAWABLE (layer)),
gimp_image_get_background (gimp_item_get_image (item), context,
gimp_drawable_type (drawable),
bg);
/* Allocate the new tiles */
@ -1780,7 +1789,7 @@ gimp_layer_flatten (GimpLayer *layer,
GIMP_IMAGE_TYPE_BYTES (new_type));
/* Configure the pixel regions */
pixel_region_init (&srcPR, gimp_drawable_get_tiles (GIMP_DRAWABLE (layer)),
pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable),
0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item),
@ -1834,6 +1843,8 @@ gimp_layer_boundary (GimpLayer *layer,
{
GimpItem *item;
BoundSeg *new_segs;
gint offset_x;
gint offset_y;
g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL);
@ -1864,28 +1875,30 @@ gimp_layer_boundary (GimpLayer *layer,
}
}
new_segs[0].x1 = item->offset_x;
new_segs[0].y1 = item->offset_y;
new_segs[0].x2 = item->offset_x;
new_segs[0].y2 = item->offset_y + gimp_item_get_height (item);
gimp_item_get_offset (item, &offset_x, &offset_y);
new_segs[0].x1 = offset_x;
new_segs[0].y1 = offset_y;
new_segs[0].x2 = offset_x;
new_segs[0].y2 = offset_y + gimp_item_get_height (item);
new_segs[0].open = 1;
new_segs[1].x1 = item->offset_x;
new_segs[1].y1 = item->offset_y;
new_segs[1].x2 = item->offset_x + gimp_item_get_width (item);
new_segs[1].y2 = item->offset_y;
new_segs[1].x1 = offset_x;
new_segs[1].y1 = offset_y;
new_segs[1].x2 = offset_x + gimp_item_get_width (item);
new_segs[1].y2 = offset_y;
new_segs[1].open = 1;
new_segs[2].x1 = item->offset_x + gimp_item_get_width (item);
new_segs[2].y1 = item->offset_y;
new_segs[2].x2 = item->offset_x + gimp_item_get_width (item);
new_segs[2].y2 = item->offset_y + gimp_item_get_height (item);
new_segs[2].x1 = offset_x + gimp_item_get_width (item);
new_segs[2].y1 = offset_y;
new_segs[2].x2 = offset_x + gimp_item_get_width (item);
new_segs[2].y2 = offset_y + gimp_item_get_height (item);
new_segs[2].open = 0;
new_segs[3].x1 = item->offset_x;
new_segs[3].y1 = item->offset_y + gimp_item_get_height (item);
new_segs[3].x2 = item->offset_x + gimp_item_get_width (item);
new_segs[3].y2 = item->offset_y + gimp_item_get_height (item);
new_segs[3].x1 = offset_x;
new_segs[3].y1 = offset_y + gimp_item_get_height (item);
new_segs[3].x2 = offset_x + gimp_item_get_width (item);
new_segs[3].y2 = offset_y + gimp_item_get_height (item);
new_segs[3].open = 0;
return new_segs;

View File

@ -201,9 +201,11 @@ gimp_layer_mask_set_layer (GimpLayerMask *layer_mask,
if (layer)
{
gchar *mask_name;
gint offset_x;
gint offset_y;
GIMP_ITEM (layer_mask)->offset_x = GIMP_ITEM (layer)->offset_x;
GIMP_ITEM (layer_mask)->offset_y = GIMP_ITEM (layer)->offset_y;
gimp_item_get_offset (GIMP_ITEM (layer), &offset_x, &offset_y);
gimp_item_set_offset (GIMP_ITEM (layer_mask), offset_x, offset_y);
mask_name = g_strdup_printf (_("%s mask"),
gimp_object_get_name (GIMP_OBJECT (layer)));

View File

@ -60,8 +60,8 @@ static void gimp_selection_resize (GimpItem *item,
GimpContext *context,
gint new_width,
gint new_height,
gint off_x,
gint off_y);
gint offset_x,
gint offset_y);
static void gimp_selection_flip (GimpItem *item,
GimpContext *context,
GimpOrientationType flip_type,
@ -211,8 +211,7 @@ gimp_selection_scale (GimpItem *item,
new_offset_x, new_offset_y,
interp_type, progress);
item->offset_x = 0;
item->offset_y = 0;
gimp_item_set_offset (item, 0, 0);
}
static void
@ -220,14 +219,13 @@ gimp_selection_resize (GimpItem *item,
GimpContext *context,
gint new_width,
gint new_height,
gint off_x,
gint off_y)
gint offset_x,
gint offset_y)
{
GIMP_ITEM_CLASS (parent_class)->resize (item, context, new_width, new_height,
off_x, off_y);
offset_x, offset_y);
item->offset_x = 0;
item->offset_y = 0;
gimp_item_set_offset (item, 0, 0);
}
static void
@ -374,15 +372,16 @@ gimp_selection_boundary (GimpChannel *channel,
gint x1, y1;
gint x2, y2;
gint off_x, off_y;
gint offset_x;
gint offset_y;
gimp_item_get_offset (GIMP_ITEM (layer), &off_x, &off_y);
gimp_item_get_offset (GIMP_ITEM (layer), &offset_x, &offset_y);
x1 = CLAMP (off_x, 0, gimp_image_get_width (image));
y1 = CLAMP (off_y, 0, gimp_image_get_height (image));
x2 = CLAMP (off_x + gimp_item_get_width (GIMP_ITEM (layer)),
x1 = CLAMP (offset_x, 0, gimp_image_get_width (image));
y1 = CLAMP (offset_y, 0, gimp_image_get_height (image));
x2 = CLAMP (offset_x + gimp_item_get_width (GIMP_ITEM (layer)),
0, gimp_image_get_width (image));
y2 = CLAMP (off_y + gimp_item_get_height (GIMP_ITEM (layer)),
y2 = CLAMP (offset_y + gimp_item_get_height (GIMP_ITEM (layer)),
0, gimp_image_get_height (image));
return GIMP_CHANNEL_CLASS (parent_class)->boundary (channel,
@ -866,8 +865,7 @@ gimp_selection_float (GimpChannel *selection,
/* Set the offsets */
tile_manager_get_offsets (tiles, &x1, &y1);
GIMP_ITEM (layer)->offset_x = x1 + off_x;
GIMP_ITEM (layer)->offset_y = y1 + off_y;
gimp_item_set_offset (GIMP_ITEM (layer), x1 + off_x, y1 + off_y);
/* Free the temp buffer */
tile_manager_unref (tiles);

View File

@ -465,12 +465,15 @@ layer_set_offsets_invoker (GimpProcedure *procedure,
if (success)
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
gint offset_x;
gint offset_y;
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
_("Move Layer"));
offx -= GIMP_ITEM (layer)->offset_x;
offy -= GIMP_ITEM (layer)->offset_y;
gimp_item_get_offset (GIMP_ITEM (layer), &offset_x, &offset_y);
offx -= offset_x;
offy -= offset_y;
gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);

View File

@ -108,8 +108,7 @@ text_render (GimpImage *image,
_("Add Text Layer"));
/* Set the layer offsets */
GIMP_ITEM (layer)->offset_x = text_x;
GIMP_ITEM (layer)->offset_y = text_y;
gimp_item_set_offset (GIMP_ITEM (layer), text_x, text_y);
/* If there is a selection mask clear it--
* this might not always be desired, but in general,

View File

@ -177,6 +177,8 @@ gimp_text_layer_from_layer (GimpLayer *layer,
GimpTextLayer *text_layer;
GimpItem *item;
GimpDrawable *drawable;
gint offset_x;
gint offset_y;
g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL);
g_return_val_if_fail (GIMP_IS_TEXT (text), NULL);
@ -205,7 +207,8 @@ gimp_text_layer_from_layer (GimpLayer *layer,
item->width = gimp_item_get_width (GIMP_ITEM (layer));
item->height = gimp_item_get_height (GIMP_ITEM (layer));
gimp_item_get_offset (GIMP_ITEM (layer), &item->offset_x, &item->offset_y);
gimp_item_get_offset (GIMP_ITEM (layer), &offset_x, &offset_y);
gimp_item_set_offset (item, offset_x, offset_y);
gimp_item_set_visible (item, gimp_item_get_visible (GIMP_ITEM (layer)), FALSE);
gimp_item_set_linked (item, gimp_item_get_linked (GIMP_ITEM (layer)), FALSE);

View File

@ -111,6 +111,8 @@ gimp_vectors_mod_undo_pop (GimpUndo *undo,
GimpVectorsModUndo *vectors_mod_undo = GIMP_VECTORS_MOD_UNDO (undo);
GimpVectors *vectors = GIMP_VECTORS (GIMP_ITEM_UNDO (undo)->item);
GimpVectors *temp;
gint offset_x;
gint offset_y;
GIMP_UNDO_CLASS (parent_class)->pop (undo, undo_mode, accum);
@ -124,10 +126,11 @@ gimp_vectors_mod_undo_pop (GimpUndo *undo,
gimp_vectors_copy_strokes (temp, vectors);
GIMP_ITEM (vectors)->width = gimp_item_get_width (GIMP_ITEM (temp));
GIMP_ITEM (vectors)->height = gimp_item_get_height (GIMP_ITEM (temp));
GIMP_ITEM (vectors)->offset_x = GIMP_ITEM (temp)->offset_x;
GIMP_ITEM (vectors)->offset_y = GIMP_ITEM (temp)->offset_y;
GIMP_ITEM (vectors)->width = gimp_item_get_width (GIMP_ITEM (temp));
GIMP_ITEM (vectors)->height = gimp_item_get_height (GIMP_ITEM (temp));
gimp_item_get_offset (GIMP_ITEM (temp), &offset_x, &offset_y);
gimp_item_set_offset (GIMP_ITEM (vectors), offset_x, offset_y);
g_object_unref (temp);

View File

@ -68,6 +68,8 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
GimpDrawable *drawable;
GimpItem *item;
GimpImage *image;
gint offset_x;
gint offset_y;
gint width;
gint height;
gint view_width;
@ -79,7 +81,9 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
drawable = GIMP_DRAWABLE (renderer->viewable);
item = GIMP_ITEM (drawable);
image = gimp_item_get_image (item);
image = gimp_item_get_image (item);
gimp_item_get_offset (item, &offset_x, &offset_y);
width = renderer->width;
height = renderer->height;
@ -135,7 +139,7 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
if (gimp_rectangle_intersect (0, 0,
gimp_item_get_width (item),
gimp_item_get_height (item),
-item->offset_x, -item->offset_y,
-offset_x, -offset_y,
gimp_image_get_width (image),
gimp_image_get_height (image),
&src_x, &src_y,
@ -196,17 +200,17 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer,
{
if (image && ! renderer->is_popup)
{
if (item->offset_x != 0)
if (offset_x != 0)
render_buf->x =
ROUND ((((gdouble) renderer->width /
(gdouble) gimp_image_get_width (image)) *
(gdouble) item->offset_x));
(gdouble) offset_x));
if (item->offset_y != 0)
if (offset_y != 0)
render_buf->y =
ROUND ((((gdouble) renderer->height /
(gdouble) gimp_image_get_height (image)) *
(gdouble) item->offset_y));
(gdouble) offset_y));
if (scaling_up)
{

View File

@ -689,12 +689,15 @@ xcf_load_layer_props (XcfInfo *info,
break;
case PROP_OFFSETS:
info->cp +=
xcf_read_int32 (info->fp,
(guint32 *) &GIMP_ITEM (layer)->offset_x, 1);
info->cp +=
xcf_read_int32 (info->fp,
(guint32 *) &GIMP_ITEM (layer)->offset_y, 1);
{
guint32 offset_x;
guint32 offset_y;
info->cp += xcf_read_int32 (info->fp, &offset_x, 1);
info->cp += xcf_read_int32 (info->fp, &offset_y, 1);
gimp_item_set_offset (GIMP_ITEM (layer), offset_x, offset_y);
}
break;
case PROP_MODE:

View File

@ -468,6 +468,8 @@ xcf_save_layer_props (XcfInfo *info,
GError **error)
{
GimpParasite *parasite = NULL;
gint offset_x;
gint offset_y;
if (layer == gimp_image_get_active_layer (image))
xcf_check_error (xcf_save_prop (info, image, PROP_ACTIVE_LAYER, error));
@ -509,9 +511,10 @@ xcf_save_layer_props (XcfInfo *info,
FALSE));
}
gimp_item_get_offset (GIMP_ITEM (layer), &offset_x, &offset_y);
xcf_check_error (xcf_save_prop (info, image, PROP_OFFSETS, error,
GIMP_ITEM (layer)->offset_x,
GIMP_ITEM (layer)->offset_y));
offset_x, offset_y));
xcf_check_error (xcf_save_prop (info, image, PROP_MODE, error,
gimp_layer_get_mode (layer)));
xcf_check_error (xcf_save_prop (info, image, PROP_TATTOO, error,

View File

@ -605,12 +605,15 @@ HELP
code => <<'CODE'
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer));
gint offset_x;
gint offset_y;
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE,
_("Move Layer"));
offx -= GIMP_ITEM (layer)->offset_x;
offy -= GIMP_ITEM (layer)->offset_y;
gimp_item_get_offset (GIMP_ITEM (layer), &offset_x, &offset_y);
offx -= offset_x;
offy -= offset_y;
gimp_item_translate (GIMP_ITEM (layer), offx, offy, TRUE);