summaryrefslogtreecommitdiff
path: root/gtk/gtkvscale.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkvscale.c')
-rw-r--r--gtk/gtkvscale.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk/gtkvscale.c b/gtk/gtkvscale.c
index 72b8b209aa..be31ec3378 100644
--- a/gtk/gtkvscale.c
+++ b/gtk/gtkvscale.c
@@ -532,7 +532,6 @@ gtk_vscale_draw_value (GtkScale *scale)
{
GtkStateType state_type;
GtkWidget *widget;
- gchar buffer[32];
gint width, height;
gint x, y;
@@ -545,10 +544,14 @@ gtk_vscale_draw_value (GtkScale *scale)
{
PangoLayout *layout;
PangoRectangle logical_rect;
+ gchar *txt;
+
+ txt = _gtk_scale_format_value (scale,
+ GTK_RANGE (scale)->adjustment->value);
+
+ layout = gtk_widget_create_pango_layout (widget, txt);
+ g_free (txt);
- sprintf (buffer, "%0.*f", GTK_RANGE (scale)->digits, GTK_RANGE (scale)->adjustment->value);
-
- layout = gtk_widget_create_pango_layout (widget, buffer);
pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
switch (scale->value_pos)