From b5e16a792c68cdd5b809b878a4573db7ba83604f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20=C4=8Cernock=C3=BD?= Date: Sat, 13 Feb 2016 19:57:41 +0100 Subject: [PATCH] Fix text and line shadow color from key --- src/color.c | 16 ---------------- src/color.h | 5 +---- src/label-line.c | 3 ++- src/label-text.c | 3 ++- 4 files changed, 5 insertions(+), 22 deletions(-) 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); -- 2.39.5