mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
app, pdb: move filter duplication to one place in
GimpItem::duplicate().
This commit is contained in:
@@ -218,43 +218,7 @@ HELP
|
||||
|
||||
if (new_item)
|
||||
{
|
||||
GimpContainer *filters;
|
||||
|
||||
layer_copy = GIMP_LAYER (new_item);
|
||||
|
||||
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (drawable));
|
||||
if (gimp_container_get_n_children (filters) > 0)
|
||||
{
|
||||
GList *filter_list;
|
||||
GimpDrawable *drawable_copy;
|
||||
|
||||
drawable_copy = GIMP_DRAWABLE (layer_copy);
|
||||
|
||||
for (filter_list = GIMP_LIST (filters)->queue->tail;
|
||||
filter_list;
|
||||
filter_list = g_list_previous (filter_list))
|
||||
{
|
||||
if (GIMP_IS_DRAWABLE_FILTER (filter_list->data))
|
||||
{
|
||||
GimpDrawableFilter *old_filter = filter_list->data;
|
||||
GimpDrawableFilter *filter;
|
||||
|
||||
filter =
|
||||
gimp_drawable_filter_duplicate (drawable_copy,
|
||||
old_filter);
|
||||
|
||||
if (filter != NULL)
|
||||
{
|
||||
gimp_drawable_filter_apply (filter, NULL);
|
||||
gimp_drawable_filter_commit (filter, TRUE, NULL,
|
||||
FALSE);
|
||||
|
||||
gimp_drawable_filter_layer_mask_freeze (filter);
|
||||
g_object_unref (filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -291,48 +255,8 @@ HELP
|
||||
{
|
||||
layer_copy = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer),
|
||||
G_TYPE_FROM_INSTANCE (layer)));
|
||||
if (layer_copy)
|
||||
{
|
||||
GimpContainer *filters;
|
||||
|
||||
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (layer));
|
||||
if (gimp_container_get_n_children (filters) > 0)
|
||||
{
|
||||
GList *filter_list;
|
||||
GimpDrawable *drawable_copy;
|
||||
|
||||
drawable_copy = GIMP_DRAWABLE (layer_copy);
|
||||
|
||||
for (filter_list = GIMP_LIST (filters)->queue->tail;
|
||||
filter_list;
|
||||
filter_list = g_list_previous (filter_list))
|
||||
{
|
||||
if (GIMP_IS_DRAWABLE_FILTER (filter_list->data))
|
||||
{
|
||||
GimpDrawableFilter *old_filter = filter_list->data;
|
||||
GimpDrawableFilter *filter;
|
||||
|
||||
filter =
|
||||
gimp_drawable_filter_duplicate (drawable_copy,
|
||||
old_filter);
|
||||
|
||||
if (filter != NULL)
|
||||
{
|
||||
gimp_drawable_filter_apply (filter, NULL);
|
||||
gimp_drawable_filter_commit (filter, TRUE, NULL,
|
||||
FALSE);
|
||||
|
||||
gimp_drawable_filter_layer_mask_freeze (filter);
|
||||
g_object_unref (filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
success = FALSE;
|
||||
}
|
||||
if (! layer_copy)
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
@@ -1319,8 +1243,6 @@ CODE
|
||||
"core/gimp.h"
|
||||
"core/gimpcontainer.h"
|
||||
"core/gimpdrawable.h"
|
||||
"core/gimpdrawable-filters.h"
|
||||
"core/gimpdrawablefilter.h"
|
||||
"core/gimpimage-color-profile.h"
|
||||
"core/gimpimage-undo.h"
|
||||
"core/gimplayer-new.h"
|
||||
|
Reference in New Issue
Block a user