Commit 8bc08dc2 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Add pango_layout_iter_get_run_baseline

This is useful information.
parent f7a99fd8
......@@ -7305,6 +7305,22 @@ pango_layout_iter_get_baseline (PangoLayoutIter *iter)
return iter->line_extents[iter->line_index].baseline;
}
int
pango_layout_iter_get_run_baseline (PangoLayoutIter *iter)
{
ItemProperties properties;
if (ITER_IS_INVALID (iter))
return 0;
if (!iter->run)
return iter->line_extents[iter->line_index].baseline;
pango_layout_get_item_properties (iter->run->item, &properties);
return iter->line_extents[iter->line_index].baseline - properties.rise;
}
/**
* pango_layout_iter_get_layout_extents:
* @iter: a `PangoLayoutIter`
......
......@@ -466,6 +466,8 @@ void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter,
PangoRectangle *logical_rect);
PANGO_AVAILABLE_IN_ALL
int pango_layout_iter_get_baseline (PangoLayoutIter *iter);
PANGO_AVAILABLE_IN_1_50
int pango_layout_iter_get_run_baseline (PangoLayoutIter *iter);
G_END_DECLS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment