summaryrefslogtreecommitdiff
path: root/demos/gtk-demo/rotated_text.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-01-23 12:07:49 -0500
committerMatthias Clasen <mclasen@redhat.com>2022-01-23 23:44:54 -0500
commit3f05313ec3d3a98db666e347133528bbd62022f0 (patch)
tree4e9c417039281ebbe48d60a1a4c63c94e3ff6c90 /demos/gtk-demo/rotated_text.c
parent9960be7eebd9e32900986b11ebef42c44b10fa94 (diff)
downloadgtk+-pango-line-breaker.tar.gz
Port to pango2 apipango-line-breaker
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 */