mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 17:59:37 +00:00
tools: Apply Warp below NDE filters
Resolves #10736. By default, any filter added with a drawable with gimp_drawable_filter_new () will be added on top of the filter stack. Now that we have NDE effects, there can be multiple live filters when drawing. The Warp tool applies a GEGL operation as well, and now it draws on top of any existing effect. This patch adds code to move the Warp's filter below any other NDE effects so it operates on the raw pixels only. Note that a longer term solution might be to have a separate stack for tool-based GEGL operations, but that would be a post 3.0 discussion.
This commit is contained in:
parent
25145b9684
commit
cbb1e81686
1 changed files with 20 additions and 1 deletions
|
@ -36,6 +36,8 @@
|
|||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpcontainer.h"
|
||||
#include "core/gimpdrawable-filters.h"
|
||||
#include "core/gimpdrawablefilter.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
|
@ -1248,12 +1250,29 @@ gimp_warp_tool_update_area (GimpWarpTool *wt,
|
|||
gboolean synchronous)
|
||||
{
|
||||
GeglRectangle rect;
|
||||
GimpContainer *filters;
|
||||
|
||||
if (! wt->filter)
|
||||
return;
|
||||
|
||||
rect = gimp_warp_tool_get_invalidated_by_change (wt, area);
|
||||
|
||||
/* Move this operation below any non-destructive filters that
|
||||
* may be active, so that it's directly affect the raw pixels. */
|
||||
filters =
|
||||
gimp_drawable_get_filters (gimp_drawable_filter_get_drawable (wt->filter));
|
||||
|
||||
if (gimp_container_have (filters, GIMP_OBJECT (wt->filter)))
|
||||
{
|
||||
gint end_index = gimp_container_get_n_children (filters) - 1;
|
||||
gint index = gimp_container_get_child_index (filters,
|
||||
GIMP_OBJECT (wt->filter));
|
||||
|
||||
if (end_index > 0 && index != end_index)
|
||||
gimp_container_reorder (filters, GIMP_OBJECT (wt->filter),
|
||||
end_index);
|
||||
}
|
||||
|
||||
if (synchronous)
|
||||
{
|
||||
GimpTool *tool = GIMP_TOOL (wt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue