1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

Compare commits

...

1 Commits

Author SHA1 Message Date
Alx Sa
dd34300e47 core: Apply filters without GUIs as NDE contextually
If someone applies a GEGL filter without a GUI like Invert
on top of a layer with existing filters, they likely expect the
filter to apply on top. Currently, we always apply filters
without GUIs destructively, which can be confusing if you
have a filter that covers the entire layer like Simplex Noise.

This patch adds a check if the layer has any visible filters,
and if so, the filter is committed non-destructively. If all
filters are currently invisible, the non-GUI filter is still
applied destructively as in 5e3047c7.
2025-06-24 16:15:44 +00:00

View File

@@ -63,6 +63,7 @@ gimp_drawable_apply_operation_with_config (GimpDrawable *drawable,
{
GimpDrawableFilter *filter;
GimpContainer *filter_stack;
gboolean is_non_destructive = FALSE;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
@@ -93,14 +94,16 @@ gimp_drawable_apply_operation_with_config (GimpDrawable *drawable,
gimp_drawable_filter_apply (filter, NULL);
is_non_destructive = gimp_drawable_has_visible_filters (drawable);
/* For destructive filters, we want them to apply directly on the
* drawable rather than merge down onto existing NDE filters */
filter_stack = gimp_drawable_get_filters (drawable);
if (filter_stack)
if (filter_stack && ! is_non_destructive)
gimp_container_reorder (filter_stack, GIMP_OBJECT (filter),
gimp_container_get_n_children (filter_stack) - 1);
gimp_drawable_filter_commit (filter, FALSE, progress, TRUE);
gimp_drawable_filter_commit (filter, is_non_destructive, progress, TRUE);
g_object_unref (filter);