[gimp] app: fix source operations on layers with alpha
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: fix source operations on layers with alpha
- Date: Mon, 23 Apr 2018 01:01:25 +0000 (UTC)
commit 5b80d3d3be25ecbfdbef86d4e11df5abadb1d064
Author: Michael Natterer <mitch gimp org>
Date: Mon Apr 23 02:59:35 2018 +0200
app: fix source operations on layers with alpha
They are not supposed to completely overwrite the layer's alpha
channel. Instead, composite them on top of the layer using gegl:over.
app/core/gimpdrawablefilter.c | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/app/core/gimpdrawablefilter.c b/app/core/gimpdrawablefilter.c
index 3ac9a44..10e123f 100644
--- a/app/core/gimpdrawablefilter.c
+++ b/app/core/gimpdrawablefilter.c
@@ -188,6 +188,8 @@ gimp_drawable_filter_new (GimpDrawable *drawable,
{
GimpDrawableFilter *filter;
GeglNode *node;
+ GeglNode *input;
+ GeglNode *effect;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
@@ -230,20 +232,28 @@ gimp_drawable_filter_new (GimpDrawable *drawable,
"operation", "gegl:nop",
NULL);
+ input = gegl_node_get_input_proxy (node, "input");
+
if (gegl_node_has_pad (filter->operation, "input"))
{
- GeglNode *input = gegl_node_get_input_proxy (node, "input");
-
- gegl_node_link_many (input,
- filter->translate,
- filter->crop,
- filter->cast_before,
- filter->transform_before,
- filter->operation,
- NULL);
+ effect = filter->operation;
+ }
+ else
+ {
+ effect = gegl_node_new_child (node,
+ "operation", "gegl:over",
+ NULL);
+
+ gegl_node_connect_to (filter->operation, "output",
+ effect, "aux");
}
- gegl_node_link_many (filter->operation,
+ gegl_node_link_many (input,
+ filter->translate,
+ filter->crop,
+ filter->cast_before,
+ filter->transform_before,
+ effect,
filter->transform_after,
filter->cast_after,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]