From a4f2a2d318ee38acac3bc1837c298e1c2ba22411 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 8 Jul 2003 00:20:31 +0000 Subject: [PATCH] show the alpha value in percent as well (as suggested in bug #116384). 2003-07-08 Sven Neumann * app/tools/gimpcolorpickertool.c: show the alpha value in percent as well (as suggested in bug #116384). --- ChangeLog | 5 +++++ app/tools/gimpcolorpickertool.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d236cbd6ef..1daa6cf156 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-07-08 Sven Neumann + + * app/tools/gimpcolorpickertool.c: show the alpha value in percent + as well (as suggested in bug #116384). + 2003-07-07 Sven Neumann * libgimpmath/gimpmatrix.[ch]: added gimp_matrix2_mult(). diff --git a/app/tools/gimpcolorpickertool.c b/app/tools/gimpcolorpickertool.c index c59160c519..76e60863ed 100644 --- a/app/tools/gimpcolorpickertool.c +++ b/app/tools/gimpcolorpickertool.c @@ -83,7 +83,7 @@ static GtkWidget *color_area = NULL; static gchar red_buf [MAX_INFO_BUF]; static gchar green_buf[MAX_INFO_BUF]; static gchar blue_buf [MAX_INFO_BUF]; -static gchar alpha_buf[MAX_INFO_BUF]; +static gchar alpha_buf[3 * MAX_INFO_BUF]; static gchar index_buf[MAX_INFO_BUF]; static gchar hex_buf [MAX_INFO_BUF]; @@ -357,7 +357,8 @@ gimp_color_picker_tool_info_update (GimpImageType sample_type, g_snprintf (blue_buf, MAX_INFO_BUF, "%d", b); if (GIMP_IMAGE_TYPE_HAS_ALPHA (sample_type)) - g_snprintf (alpha_buf, MAX_INFO_BUF, "%d", a); + g_snprintf (alpha_buf, sizeof (alpha_buf), + "%d (%d %%)", a, (gint) (color->a * 100.0)); else g_snprintf (alpha_buf, MAX_INFO_BUF, _("N/A"));