summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-29 21:21:10 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-29 21:23:10 -0400
commit1dee72bfc9597b5564d2f46e704f547fab89b9e8 (patch)
treea897aca71c7be2fe232da129bfa61fbebc5c4c42
parent8bc08dc2900da1cbb34987934b8954fdb576dfeb (diff)
downloadpango-1dee72bfc9597b5564d2f46e704f547fab89b9e8.tar.gz
pango-view: Use the new api
Use the new run baseline api to correct the positioning of glyph extents and caret positions.
-rw-r--r--utils/viewer-pangocairo.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/utils/viewer-pangocairo.c b/utils/viewer-pangocairo.c
index 6918d2e9..b35f6f3b 100644
--- a/utils/viewer-pangocairo.c
+++ b/utils/viewer-pangocairo.c
@@ -434,8 +434,7 @@ render_callback (PangoLayout *layout,
pango_layout_iter_get_run_extents (iter, NULL, &rect);
x_pos = rect.x;
- /* FIXME: need a run baseline */
- y_pos = pango_layout_iter_get_baseline (iter);
+ y_pos = pango_layout_iter_get_run_baseline (iter);
for (int i = 0; i < run->glyphs->num_glyphs; i++)
{
@@ -504,7 +503,7 @@ render_callback (PangoLayout *layout,
offset = g_utf8_strlen (text, start - text);
- y = pango_layout_iter_get_baseline (iter);
+ y = pango_layout_iter_get_run_baseline (iter);
trailing = FALSE;
p = start;