summaryrefslogtreecommitdiff
path: root/utils/viewer-pangocairo.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-27 10:33:24 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-27 11:06:54 -0400
commit1157f4ca8c6af8592c55f9c90b37e8b05450a925 (patch)
tree0c31abb93a5ff41487ac9e1f3bf9a38ecfd726f6 /utils/viewer-pangocairo.c
parent0fa8f933e051248b83230502754d000f693bb276 (diff)
downloadpango-1157f4ca8c6af8592c55f9c90b37e8b05450a925.tar.gz
pango-viewer: Number carets
When showing caret positions, put a little number next to them to indicate the order.
Diffstat (limited to 'utils/viewer-pangocairo.c')
-rw-r--r--utils/viewer-pangocairo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/viewer-pangocairo.c b/utils/viewer-pangocairo.c
index fa53d9fb..4b27c7e5 100644
--- a/utils/viewer-pangocairo.c
+++ b/utils/viewer-pangocairo.c
@@ -456,9 +456,16 @@ render_callback (PangoLayout *layout,
&x);
x += rect.x;
+ cairo_set_source_rgba (cr, 1.0, 0.0, 1.0, 0.5);
cairo_arc (cr, x / PANGO_SCALE, y / PANGO_SCALE, 3.0, 0, 2*G_PI);
cairo_close_path (cr);
cairo_fill (cr);
+
+ char *s = g_strdup_printf ("%d", i + trailing);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_move_to (cr, x / PANGO_SCALE - 5, y / PANGO_SCALE + 15);
+ cairo_show_text (cr, s);
+ g_free (s);
}
if (i < run->item->num_chars)