Commit c7ca43a6 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

added VISIBLE and LINKED to the GimpImageResizeLayers enum.

2005-03-01  Michael Natterer  <mitch@gimp.org>

	* app/core/core-enums.[ch]: added VISIBLE and LINKED to the
	GimpImageResizeLayers enum.

	* app/core/gimpimage-resize.c (gimp_image_resize_with_layers):
	changed accordingly. Also looks nicer now.
parent 1fa722aa
2005-03-01 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.[ch]: added VISIBLE and LINKED to the
GimpImageResizeLayers enum.
* app/core/gimpimage-resize.c (gimp_image_resize_with_layers):
changed accordingly. Also looks nicer now.
2005-03-01 Sven Neumann <sven@gimp.org>
* plug-ins/ifscompose/ifscompose.[ch]
......
......@@ -443,6 +443,8 @@ gimp_image_resize_layers_get_type (void)
{
{ GIMP_IMAGE_RESIZE_LAYERS_NONE, "GIMP_IMAGE_RESIZE_LAYERS_NONE", "none" },
{ GIMP_IMAGE_RESIZE_LAYERS_MATCHING, "GIMP_IMAGE_RESIZE_LAYERS_MATCHING", "matching" },
{ GIMP_IMAGE_RESIZE_LAYERS_VISIBLE, "GIMP_IMAGE_RESIZE_LAYERS_VISIBLE", "visible" },
{ GIMP_IMAGE_RESIZE_LAYERS_LINKED, "GIMP_IMAGE_RESIZE_LAYERS_LINKED", "linked" },
{ GIMP_IMAGE_RESIZE_LAYERS_ALL, "GIMP_IMAGE_RESIZE_LAYERS_ALL", "all" },
{ 0, NULL, NULL }
};
......@@ -451,6 +453,8 @@ gimp_image_resize_layers_get_type (void)
{
{ GIMP_IMAGE_RESIZE_LAYERS_NONE, N_("None"), NULL },
{ GIMP_IMAGE_RESIZE_LAYERS_MATCHING, N_("Image-sized layers"), NULL },
{ GIMP_IMAGE_RESIZE_LAYERS_VISIBLE, N_("All visible layers"), NULL },
{ GIMP_IMAGE_RESIZE_LAYERS_LINKED, N_("All linked layers"), NULL },
{ GIMP_IMAGE_RESIZE_LAYERS_ALL, N_("All layers"), NULL },
{ 0, NULL, NULL }
};
......
......@@ -222,6 +222,8 @@ typedef enum /*< pdb-skip >*/
{
GIMP_IMAGE_RESIZE_LAYERS_NONE, /*< desc="None" >*/
GIMP_IMAGE_RESIZE_LAYERS_MATCHING, /*< desc="Image-sized layers" >*/
GIMP_IMAGE_RESIZE_LAYERS_VISIBLE, /*< desc="All visible layers" >*/
GIMP_IMAGE_RESIZE_LAYERS_LINKED, /*< desc="All linked layers" >*/
GIMP_IMAGE_RESIZE_LAYERS_ALL /*< desc="All layers" >*/
} GimpImageResizeLayers;
......
......@@ -138,23 +138,43 @@ gimp_image_resize_with_layers (GimpImage *gimage,
GimpItem *item = list->data;
gint old_offset_x;
gint old_offset_y;
gboolean resize;
gimp_item_offsets (item, &old_offset_x, &old_offset_y);
gimp_item_translate (item, offset_x, offset_y, TRUE);
if (resize_layers == GIMP_IMAGE_RESIZE_LAYERS_ALL ||
(resize_layers == GIMP_IMAGE_RESIZE_LAYERS_MATCHING &&
old_offset_x == 0 &&
old_offset_y == 0 &&
gimp_item_width (item) == old_width &&
gimp_item_height (item) == old_height))
switch (resize_layers)
{
gimp_item_resize (item, context,
new_width, new_height,
offset_x + old_offset_x, offset_y + old_offset_y);
case GIMP_IMAGE_RESIZE_LAYERS_MATCHING:
resize = (old_offset_x == 0 &&
old_offset_y == 0 &&
gimp_item_width (item) == old_width &&
gimp_item_height (item) == old_height);
break;
case GIMP_IMAGE_RESIZE_LAYERS_VISIBLE:
resize = gimp_item_get_visible (item);
break;
case GIMP_IMAGE_RESIZE_LAYERS_LINKED:
resize = gimp_item_get_linked (item);
break;
case GIMP_IMAGE_RESIZE_LAYERS_ALL:
resize = TRUE;
break;
default:
resize = FALSE;
break;
}
if (resize)
gimp_item_resize (item, context,
new_width, new_height,
offset_x + old_offset_x, offset_y + old_offset_y);
if (progress)
gimp_progress_set_value (progress, progress_current++ / progress_max);
}
......
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