app/widgets: Fix Fade visibility in Paint Dynamics Output Editor

The Fade curve is meant to use the widget's foreground color. The current
code detects this by checking if the curve's predefined color has an alpha
value of 0 - if it does, INPUT_COLOR (i) returns NULL and sends a NULL color
variable to gimp_curve_view_set_curve ().

However, since the GeglColor port, the "color" variable is an empty
GeglColor object rather than a pure NULL value. Thus, the line was always
drawn with the default GeglColor value which is difficult to see in light mode.

This patch adds a tertiary conditional statement so that a pure NULL is sent if
the alpha value is 0, rather than the color variable.
This commit is contained in:
Alx Sa 2024-09-29 05:14:59 +00:00
parent c57c2dbbed
commit 1cfe27e73e

View file

@ -423,7 +423,8 @@ gimp_dynamics_output_editor_activate_input (GimpDynamicsOutputEditor *editor,
if (input == i)
{
gimp_curve_view_set_curve (GIMP_CURVE_VIEW (private->curve_view),
input_curve, color);
input_curve,
(INPUT_COLOR (i) != NULL) ? color : NULL);
private->active_curve = input_curve;
gimp_curve_view_set_x_axis_label (GIMP_CURVE_VIEW (private->curve_view),
@ -432,7 +433,8 @@ gimp_dynamics_output_editor_activate_input (GimpDynamicsOutputEditor *editor,
else if (use_input)
{
gimp_curve_view_add_background (GIMP_CURVE_VIEW (private->curve_view),
input_curve, color);
input_curve,
(INPUT_COLOR (i) != NULL) ? color : NULL);
}
g_object_unref (input_curve);
@ -478,7 +480,8 @@ gimp_dynamics_output_editor_notify_output (GimpDynamicsOutput *output,
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), INPUT_COLOR (i));
gimp_curve_view_add_background (GIMP_CURVE_VIEW (private->curve_view),
input_curve, color);
input_curve,
(INPUT_COLOR (i) != NULL) ? color : NULL);
g_object_unref (color);
}
else