diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-09 03:04:21 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-09 03:04:21 +0000 |
commit | c4d138179443b49d817830c78ddcd1459cf5505f (patch) | |
tree | 105703add2c026aeff6d297d244bc6d9e2c579d7 /tests/test-bidi.c | |
parent | f437641bcc412d7e7ac2f706487bbbdeaeddc87e (diff) | |
parent | 336dca6530d9dc41b101018d7f4af4a27e70445d (diff) | |
download | pango-c4d138179443b49d817830c78ddcd1459cf5505f.tar.gz |
Merge branch 'line-height-attribute' into 'main'
Implement css-like line-height
See merge request GNOME/pango!390
Diffstat (limited to 'tests/test-bidi.c')
-rw-r--r-- | tests/test-bidi.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test-bidi.c b/tests/test-bidi.c index 35f2a39d..7a137518 100644 --- a/tests/test-bidi.c +++ b/tests/test-bidi.c @@ -352,6 +352,9 @@ test_move_cursor_para (void) int index; int trailing; const char *text; + int line_no; + PangoLayoutLine *line; + PangoRectangle ext; layout = pango_layout_new (context); @@ -387,9 +390,14 @@ test_move_cursor_para (void) if (index >= strlen (tests[i].text) - 1) break; + pango_layout_index_to_line_x (layout, index, FALSE, &line_no, NULL); + line = pango_layout_get_line (layout, line_no); + pango_layout_line_get_extents (line, NULL, &ext); + pango_layout_get_cursor_pos (layout, index, &pos, NULL); - g_assert_true (pos.y > old_pos.y || - (pos.y == old_pos.y && pos.x > old_pos.x)); + // assert that we are either moving to the right + // or jumping to the next line + g_assert_true (pos.y > ext.y + ext.height || pos.x > old_pos.x); } } |