gegl r2496 - in trunk: . gegl/property-types
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2496 - in trunk: . gegl/property-types
- Date: Mon, 23 Jun 2008 12:56:02 +0000 (UTC)
Author: ok
Date: Mon Jun 23 12:56:02 2008
New Revision: 2496
URL: http://svn.gnome.org/viewvc/gegl?rev=2496&view=rev
Log:
* gegl/property-types/gegl-color.c: (gegl_color_get_string): applied
change from Peter gib_mir_mehl at gmx.net.
Modified:
trunk/ChangeLog
trunk/gegl/property-types/gegl-color.c
Modified: trunk/gegl/property-types/gegl-color.c
==============================================================================
--- trunk/gegl/property-types/gegl-color.c (original)
+++ trunk/gegl/property-types/gegl-color.c Mon Jun 23 12:56:02 2008
@@ -359,18 +359,20 @@
if (priv->rgba_color[3] == 1.0)
{
- return g_strdup_printf ("rgb(%1.4f, %1.4f, %1.4f)",
- priv->rgba_color[0],
- priv->rgba_color[1],
- priv->rgba_color[2]);
+ gchar buf [3][G_ASCII_DTOSTR_BUF_SIZE];
+ g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%1.4f", priv->rgba_color[0]);
+ g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%1.4f", priv->rgba_color[1]);
+ g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%1.4f", priv->rgba_color[2]);
+ return g_strdup_printf ("rgb(%s, %s, %s)", buf[0], buf[1], buf[2]);
}
else
{
- return g_strdup_printf ("rgba(%1.4f, %1.4f, %1.4f, %1.4f)",
- priv->rgba_color[0],
- priv->rgba_color[1],
- priv->rgba_color[2],
- priv->rgba_color[3]);
+ gchar buf [4][G_ASCII_DTOSTR_BUF_SIZE];
+ g_ascii_formatd (buf[0], G_ASCII_DTOSTR_BUF_SIZE, "%1.4f", priv->rgba_color[0]);
+ g_ascii_formatd (buf[1], G_ASCII_DTOSTR_BUF_SIZE, "%1.4f", priv->rgba_color[1]);
+ g_ascii_formatd (buf[2], G_ASCII_DTOSTR_BUF_SIZE, "%1.4f", priv->rgba_color[2]);
+ g_ascii_formatd (buf[3], G_ASCII_DTOSTR_BUF_SIZE, "%1.4f", priv->rgba_color[3]);
+ return g_strdup_printf ("rgba(%s, %s, %s, %s)", buf[0], buf[1], buf[2], buf[3]);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]