summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-05-08 22:17:54 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-05-08 22:17:54 -0400
commit1661f1b2c1651009c324f851eeee1957db097910 (patch)
tree181e2c12353ce4b7e941dc43444ed8aaab80fbc7
parentb3ebe097a3042737165ba497dc5b08f235df8167 (diff)
downloadpango-fix-empty-line-spacing.tar.gz
layout: handle empty lines betterfix-empty-line-spacing
When using line-spacing, we were not giving empty lines their expected width. Fix that. Fixes: #499
-rw-r--r--pango/pango-layout.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 57ec7606..c483526f 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -5213,8 +5213,15 @@ pango_layout_line_get_extents_and_height (PangoLayoutLine *line,
tmp_list = tmp_list->next;
}
- if (logical_rect && !line->runs)
- pango_layout_line_get_empty_extents (line, logical_rect);
+ if (!line->runs)
+ {
+ PangoRectangle r, *rect;
+
+ rect = logical_rect ? logical_rect : &r;
+ pango_layout_line_get_empty_extents (line, rect);
+ if (height)
+ *height = rect->height;
+ }
if (caching)
{