summaryrefslogtreecommitdiff
path: root/demos/gtk-demo/rotated_text.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/gtk-demo/rotated_text.c')
-rw-r--r--demos/gtk-demo/rotated_text.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/demos/gtk-demo/rotated_text.c b/demos/gtk-demo/rotated_text.c
index 4f2c3f9513..16a7131705 100644
--- a/demos/gtk-demo/rotated_text.c
+++ b/demos/gtk-demo/rotated_text.c
@@ -142,13 +142,14 @@ rotated_text_draw (GtkDrawingArea *da,
/* Draw the layout N_WORDS times in a circle */
for (i = 0; i < N_WORDS; i++)
{
- int layout_width, layout_height;
+ PangoRectangle ext;
/* Inform Pango to re-layout the text with the new transformation matrix */
pango_cairo_update_layout (cr, layout);
- pango_layout_get_pixel_size (layout, &layout_width, &layout_height);
- cairo_move_to (cr, - layout_width / 2, - RADIUS * .9);
+ pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
+ pango_extents_to_pixels (&ext, NULL);
+ cairo_move_to (cr, - ext.width / 2, - RADIUS * .9);
pango_cairo_show_layout (cr, layout);
/* Rotate for the next turn */