From: Marek Černocký Date: Sat, 13 Feb 2016 18:57:41 +0000 (+0100) Subject: Fix text and line shadow color from key X-Git-Tag: glabels-3_4_0~48 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b5e16a792c68cdd5b809b878a4573db7ba83604f;p=glabels Fix text and line shadow color from key --- diff --git a/src/color.c b/src/color.c index 2a87c9e1..d9e81979 100644 --- a/src/color.c +++ b/src/color.c @@ -40,22 +40,6 @@ gl_color_set_opacity (guint color, } -/*****************************************************************************/ -/* Resolve actual shadow color by adjusting opacity. */ -/*****************************************************************************/ -guint -gl_color_shadow (guint base_color, - gdouble opacity, - guint object_color) -{ - guint color; - - color = gl_color_set_opacity (base_color, - opacity * GL_COLOR_F_ALPHA (object_color)); - - return color; -} - /*****************************************************************************/ /* Convert gLabels color into a GdkColor */ diff --git a/src/color.h b/src/color.h index 48feed7e..78cbe60f 100644 --- a/src/color.h +++ b/src/color.h @@ -83,11 +83,8 @@ G_BEGIN_DECLS guint gl_color_set_opacity (guint color, - gdouble opacity); + gdouble opacity); -guint gl_color_shadow (guint base_color, - gdouble opacity, - guint object_color); /* * Routines to convert to/from GdkColor. diff --git a/src/label-line.c b/src/label-line.c index c88e2ed3..e6864ab5 100644 --- a/src/label-line.c +++ b/src/label-line.c @@ -347,12 +347,13 @@ draw_shadow (glLabelObject *object, } shadow_color_node = gl_label_object_get_shadow_color (object); + shadow_line_color = gl_color_node_expand (shadow_color_node, record); if (shadow_color_node->field_flag) { shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT; } shadow_opacity = gl_label_object_get_shadow_opacity (object); - shadow_line_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, line_color_node->color); + shadow_line_color = gl_color_set_opacity (shadow_line_color, shadow_opacity); cairo_move_to (cr, 0.0, 0.0); diff --git a/src/label-text.c b/src/label-text.c index 13e9f943..44dc10bc 100644 --- a/src/label-text.c +++ b/src/label-text.c @@ -1277,12 +1277,13 @@ draw_shadow (glLabelObject *object, gl_color_node_free (&color_node); shadow_color_node = gl_label_object_get_shadow_color (object); + shadow_color = gl_color_node_expand (shadow_color_node, record); if (shadow_color_node->field_flag) { shadow_color_node->color = GL_COLOR_SHADOW_MERGE_DEFAULT; } shadow_opacity = gl_label_object_get_shadow_opacity (object); - shadow_color = gl_color_shadow (shadow_color_node->color, shadow_opacity, color); + shadow_color = gl_color_set_opacity (shadow_color, shadow_opacity); gl_color_node_free (&shadow_color_node); draw_text_real (object, cr, screen_flag, record, shadow_color);