mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
app/display: Copy filters when layers are dropped on tabs
Resolves issue #12203.
Similar to d87c728f
, dragging a layer over to a new image via
the tabs uses gimp_image_new_from_drawable () and only
copies a single layer. This patch adds the filter copy code
here as well.
This commit is contained in:
parent
1a70e911b1
commit
37d94f3fd6
1 changed files with 36 additions and 0 deletions
|
@ -30,7 +30,10 @@
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimp-edit.h"
|
#include "core/gimp-edit.h"
|
||||||
#include "core/gimpbuffer.h"
|
#include "core/gimpbuffer.h"
|
||||||
|
#include "core/gimpcontainer.h"
|
||||||
#include "core/gimpdrawable-edit.h"
|
#include "core/gimpdrawable-edit.h"
|
||||||
|
#include "core/gimpdrawable-filters.h"
|
||||||
|
#include "core/gimpdrawablefilter.h"
|
||||||
#include "core/gimpfilloptions.h"
|
#include "core/gimpfilloptions.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimpimage-new.h"
|
#include "core/gimpimage-new.h"
|
||||||
|
@ -38,6 +41,7 @@
|
||||||
#include "core/gimplayer.h"
|
#include "core/gimplayer.h"
|
||||||
#include "core/gimplayer-new.h"
|
#include "core/gimplayer-new.h"
|
||||||
#include "core/gimplayermask.h"
|
#include "core/gimplayermask.h"
|
||||||
|
#include "core/gimplist.h"
|
||||||
#include "core/gimppattern.h"
|
#include "core/gimppattern.h"
|
||||||
#include "core/gimpprogress.h"
|
#include "core/gimpprogress.h"
|
||||||
|
|
||||||
|
@ -243,6 +247,8 @@ gimp_display_shell_drop_drawable (GtkWidget *widget,
|
||||||
|
|
||||||
if (new_item)
|
if (new_item)
|
||||||
{
|
{
|
||||||
|
GimpContainer *filters;
|
||||||
|
|
||||||
GimpLayer *new_layer = GIMP_LAYER (new_item);
|
GimpLayer *new_layer = GIMP_LAYER (new_item);
|
||||||
|
|
||||||
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE,
|
||||||
|
@ -250,6 +256,36 @@ gimp_display_shell_drop_drawable (GtkWidget *widget,
|
||||||
|
|
||||||
gimp_display_shell_dnd_position_item (shell, image, new_item);
|
gimp_display_shell_dnd_position_item (shell, image, new_item);
|
||||||
|
|
||||||
|
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (viewable));
|
||||||
|
if (gimp_container_get_n_children (filters) > 0)
|
||||||
|
{
|
||||||
|
GList *filter_list;
|
||||||
|
|
||||||
|
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 (GIMP_DRAWABLE (new_layer),
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gimp_item_set_visible (new_item, TRUE, FALSE);
|
gimp_item_set_visible (new_item, TRUE, FALSE);
|
||||||
|
|
||||||
gimp_image_add_layer (image, new_layer,
|
gimp_image_add_layer (image, new_layer,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue