summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-08 21:56:43 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-08 21:56:43 -0400
commit336dca6530d9dc41b101018d7f4af4a27e70445d (patch)
treee6c2cd8952df470d53f3fc08e003301d99856cba
parente2def596629bd6e9499d6b455cd645b360a9b7aa (diff)
downloadpango-line-height-attribute.tar.gz
Now that we are using run extents for cursor positions, the vertical extents aren't necessarily constant across a line anymore. Adapt our assertions.
-rw-r--r--tests/test-bidi.c12
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);
}
}