app/core/gimpdrawable-offset.c (gimp_drawable_offset)

2004-03-14  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
	* app/core/gimpdrawable.c (gimp_drawable_scale) (gimp_drawable_resize)
	* app/core/gimplayer.c (gimp_layer_convert) (gimp_layer_add_alpha):
	use gimp_drawable_set_tiles() instead of fiddling with
	drawable->tiles, ->bytes etc. manually.
This commit is contained in:
Michael Natterer 2004-03-14 11:34:31 +00:00 committed by Michael Natterer
parent f36b751ce1
commit d1fe0f9e6b
4 changed files with 25 additions and 23 deletions

View File

@ -1,3 +1,11 @@
2004-03-14 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
* app/core/gimpdrawable.c (gimp_drawable_scale) (gimp_drawable_resize)
* app/core/gimplayer.c (gimp_layer_convert) (gimp_layer_add_alpha):
use gimp_drawable_set_tiles() instead of fiddling with
drawable->tiles, ->bytes etc. manually.
2004-03-13 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdialogfactory.[ch]: made enum

View File

@ -70,7 +70,7 @@ gimp_drawable_offset (GimpDrawable *drawable,
offset_x += width;
while (offset_y < 0)
offset_y += height;
offset_x %= width;
offset_y %= height;
}
@ -321,9 +321,10 @@ gimp_drawable_offset (GimpDrawable *drawable,
gimp_drawable_data (drawable),
FALSE);
/* swap the tiles */
tile_manager_unref (drawable->tiles);
drawable->tiles = new_tiles;
/* set the tiles */
gimp_drawable_set_tiles (drawable, FALSE, NULL,
new_tiles, gimp_drawable_type (drawable));
tile_manager_unref (new_tiles);
/* update the drawable */
gimp_drawable_update (drawable,

View File

@ -373,8 +373,9 @@ gimp_drawable_scale (GimpItem *item,
GIMP_INTERPOLATION_NONE : interpolation_type,
progress_callback, progress_data);
tile_manager_unref (drawable->tiles);
drawable->tiles = new_tiles;
gimp_drawable_set_tiles (drawable, FALSE, NULL,
new_tiles, gimp_drawable_type (drawable));
tile_manager_unref (new_tiles);
GIMP_ITEM_CLASS (parent_class)->scale (item, new_width, new_height,
new_offset_x, new_offset_y,
@ -454,8 +455,9 @@ gimp_drawable_resize (GimpItem *item,
copy_region (&srcPR, &destPR);
}
tile_manager_unref (drawable->tiles);
drawable->tiles = new_tiles;
gimp_drawable_set_tiles (drawable, FALSE, NULL,
new_tiles, gimp_drawable_type (drawable));
tile_manager_unref (new_tiles);
GIMP_ITEM_CLASS (parent_class)->resize (item, new_width, new_height,
offset_x, offset_y);

View File

@ -540,12 +540,8 @@ gimp_layer_convert (GimpItem *item,
break;
}
tile_manager_unref (new_drawable->tiles);
new_drawable->tiles = new_tiles;
new_drawable->type = new_type;
new_drawable->bytes = GIMP_IMAGE_TYPE_BYTES (new_type);
new_drawable->has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (new_type);
gimp_drawable_set_tiles (new_drawable, FALSE, NULL, new_tiles, new_type);
tile_manager_unref (new_tiles);
}
if (new_layer->mask && dest_image != item->gimage)
@ -1403,16 +1399,11 @@ gimp_layer_add_alpha (GimpLayer *layer)
/* Add an alpha channel */
add_alpha_region (&srcPR, &destPR);
/* Push the layer on the undo stack */
gimp_image_undo_push_layer_mod (gimage, _("Add Alpha Channel"), layer);
/* Set the new tiles */
gimp_drawable_set_tiles (GIMP_DRAWABLE (layer), TRUE, _("Add Alpha Channel"),
new_tiles, new_type);
tile_manager_unref (new_tiles);
/* Configure the new layer */
tile_manager_unref (GIMP_DRAWABLE (layer)->tiles);
GIMP_DRAWABLE (layer)->tiles = new_tiles;
GIMP_DRAWABLE (layer)->type = new_type;
GIMP_DRAWABLE (layer)->bytes = GIMP_IMAGE_TYPE_BYTES (new_type);
GIMP_DRAWABLE (layer)->has_alpha = TRUE;
GIMP_DRAWABLE (layer)->preview_valid = FALSE;
gimp_drawable_alpha_changed (GIMP_DRAWABLE (layer));