forked from AuroraMiddleware/gtk
gdkrgba: Use %g instead of %.17g to print alpha
This way 0.3 isn't printed as 0.29999999999999
This commit is contained in:
parent
5ebb713df5
commit
96a485d8b2
@ -366,7 +366,7 @@ gdk_rgba_to_string (const GdkRGBA *rgba)
|
||||
{
|
||||
gchar alpha[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_ascii_dtostr (alpha, G_ASCII_DTOSTR_BUF_SIZE, CLAMP (rgba->alpha, 0, 1));
|
||||
g_ascii_formatd (alpha, G_ASCII_DTOSTR_BUF_SIZE, "%g", CLAMP (rgba->alpha, 0, 1));
|
||||
|
||||
return g_strdup_printf ("rgba(%d,%d,%d,%s)",
|
||||
(int)(0.5 + CLAMP (rgba->red, 0., 1.) * 255.),
|
||||
|
Loading…
Reference in New Issue
Block a user