diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-08 15:10:55 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-08 15:10:55 +0000 |
commit | 3b8231f36e9c4702b696f5031857502928f58cdf (patch) | |
tree | 99e852b9df435cd3520e6537069d3f456599dbd4 /tests/test-layout.c | |
parent | 4d4d9e02892f6ed8496af5e2c6067d650eff3fd5 (diff) | |
parent | 46fd479568f98ad94e3e1b0d1935040706d7558c (diff) | |
download | pango-3b8231f36e9c4702b696f5031857502928f58cdf.tar.gz |
Merge branch 'bidi-revenge' into 'main'
Reimplement pango_layout_move_cursor_visually
Closes #587, #585, and #157
See merge request GNOME/pango!389
Diffstat (limited to 'tests/test-layout.c')
-rw-r--r-- | tests/test-layout.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test-layout.c b/tests/test-layout.c index f35d839e..e533618d 100644 --- a/tests/test-layout.c +++ b/tests/test-layout.c @@ -194,15 +194,22 @@ dump_directions (PangoLayout *layout, GString *string) static void dump_cursor_positions (PangoLayout *layout, GString *string) { + const char *text; int index, trailing; + text = pango_layout_get_text (layout); + index = 0; trailing = 0; while (index < G_MAXINT) { g_string_append_printf (string, "%d(%d) ", index, trailing); - pango_layout_move_cursor_visually (layout, TRUE, index, trailing, 1, &index, &trailing); + + while (trailing--) + index = g_utf8_next_char (text + index) - text; + + pango_layout_move_cursor_visually (layout, TRUE, index, 0, 1, &index, &trailing); } g_string_append (string, "\n"); |