summaryrefslogtreecommitdiff
path: root/gtk/gtkhscale.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-07-02 21:32:56 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-07-02 21:32:56 +0000
commitbf87b7c6281f98b44f732c7c1c274129d83c5a7a (patch)
treed595f39147e0ff2a6a7e1eb18b6170093942c547 /gtk/gtkhscale.c
parentb02ebc65e4a0aa3d6b198d5491589f4ac3e60365 (diff)
downloadgdk-pixbuf-bf87b7c6281f98b44f732c7c1c274129d83c5a7a.tar.gz
Use pango_layout_get_pixel_extents() to remove a large number of '/
Sun Jul 2 17:06:40 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkcalendar.c gtk/gtkclist.c gtk/gtkctree.c gtk/gtkhscale.c gtk/gtkprogressbar.c gtk/gtkscale.c gtk/gtkvscale.c gtk/gtkaccellabel.c: Use pango_layout_get_pixel_extents() to remove a large number of '/ PANGO_SCALE'. * gtk/gtk[hv]ruler.c gtk/gtklabel.c: replace some / PANGO_SCALE with PANGO_PIXELS() macro.
Diffstat (limited to 'gtk/gtkhscale.c')
-rw-r--r--gtk/gtkhscale.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gtk/gtkhscale.c b/gtk/gtkhscale.c
index b1e0f8c8f..5b5cfa711 100644
--- a/gtk/gtkhscale.c
+++ b/gtk/gtkhscale.c
@@ -528,7 +528,7 @@ gtk_hscale_draw_value (GtkScale *scale)
layout = gtk_widget_create_pango_layout (widget);
pango_layout_set_text (layout, buffer, -1);
- pango_layout_get_extents (layout, NULL, &logical_rect);
+ pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
switch (scale->value_pos)
{
@@ -536,15 +536,15 @@ gtk_hscale_draw_value (GtkScale *scale)
gdk_window_get_position (GTK_RANGE (scale)->trough, &x, &y);
gdk_window_get_size (GTK_RANGE (scale)->trough, &width, &height);
- x -= SCALE_CLASS (scale)->value_spacing + logical_rect.width / PANGO_SCALE;
- y += (height - logical_rect.height / PANGO_SCALE) / 2;
+ x -= SCALE_CLASS (scale)->value_spacing + logical_rect.width;
+ y += (height - logical_rect.height) / 2;
break;
case GTK_POS_RIGHT:
gdk_window_get_position (GTK_RANGE (scale)->trough, &x, &y);
gdk_window_get_size (GTK_RANGE (scale)->trough, &width, &height);
x += width + SCALE_CLASS (scale)->value_spacing;
- y += (height - logical_rect.height / PANGO_SCALE) / 2;
+ y += (height - logical_rect.height) / 2;
break;
case GTK_POS_TOP:
gdk_window_get_position (GTK_RANGE (scale)->slider, &x, NULL);
@@ -552,10 +552,10 @@ gtk_hscale_draw_value (GtkScale *scale)
gdk_window_get_size (GTK_RANGE (scale)->slider, &width, NULL);
gdk_window_get_size (GTK_RANGE (scale)->trough, NULL, &height);
- x += widget->allocation.x + (width - logical_rect.width / PANGO_SCALE) / 2;
+ x += widget->allocation.x + (width - logical_rect.width) / 2;
x = CLAMP (x, widget->allocation.x,
- widget->allocation.x + widget->allocation.width - logical_rect.width / PANGO_SCALE);
- y -= logical_rect.height / PANGO_SCALE;
+ widget->allocation.x + widget->allocation.width - logical_rect.width);
+ y -= logical_rect.height;
break;
case GTK_POS_BOTTOM:
gdk_window_get_position (GTK_RANGE (scale)->slider, &x, NULL);
@@ -563,9 +563,9 @@ gtk_hscale_draw_value (GtkScale *scale)
gdk_window_get_size (GTK_RANGE (scale)->slider, &width, NULL);
gdk_window_get_size (GTK_RANGE (scale)->trough, NULL, &height);
- x += widget->allocation.x + (width - logical_rect.width / PANGO_SCALE) / 2;
+ x += widget->allocation.x + (width - logical_rect.width) / 2;
x = CLAMP (x, widget->allocation.x,
- widget->allocation.x + widget->allocation.width - logical_rect.width / PANGO_SCALE);
+ widget->allocation.x + widget->allocation.width - logical_rect.width);
y += height;
break;
}