From 84066ca26ae635ee87f2db15294f0d0d89e15c9e Mon Sep 17 00:00:00 2001 From: Ell Date: Tue, 2 Oct 2018 21:23:34 -0400 Subject: [PATCH] app: use "step" blending function in "FG to BG (Hardedge)" gradient Use a single segment with a "step" blending function, added in the previous commit, instead of two separate segments, for the "FG to BG (Hardedge)" internal gradient. This makes it simpler to change its endpoint colors by modifying the gradient, instead of changing the FG/BG colors. --- app/core/gimp-gradients.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/app/core/gimp-gradients.c b/app/core/gimp-gradients.c index 9602db25d2..2c4ec0fa1e 100644 --- a/app/core/gimp-gradients.c +++ b/app/core/gimp-gradients.c @@ -81,18 +81,9 @@ gimp_gradients_init (Gimp *gimp) gradient = gimp_gradients_add_gradient (gimp, _("FG to BG (Hardedge)"), FG_BG_HARDEDGE_KEY); - gradient->segments->left = 0.00; - gradient->segments->middle = 0.25; - gradient->segments->right = 0.50; - gradient->segments->left_color_type = GIMP_GRADIENT_COLOR_FOREGROUND; - gradient->segments->right_color_type = GIMP_GRADIENT_COLOR_FOREGROUND; - gradient->segments->next = gimp_gradient_segment_new (); - gradient->segments->next->prev = gradient->segments; - gradient->segments->next->left = 0.50; - gradient->segments->next->middle = 0.75; - gradient->segments->next->right = 1.00; - gradient->segments->next->left_color_type = GIMP_GRADIENT_COLOR_BACKGROUND; - gradient->segments->next->right_color_type = GIMP_GRADIENT_COLOR_BACKGROUND; + gradient->segments->left_color_type = GIMP_GRADIENT_COLOR_FOREGROUND; + gradient->segments->right_color_type = GIMP_GRADIENT_COLOR_BACKGROUND; + gradient->segments->type = GIMP_GRADIENT_SEGMENT_STEP; /* FG to BG (HSV counter-clockwise) */ gradient = gimp_gradients_add_gradient (gimp,