summaryrefslogtreecommitdiff
path: root/pango/pango-layout.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-11-03 12:27:34 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-11-03 12:27:34 +0000
commit5b7b3684e18b636bce901688085226694d44adf4 (patch)
treeb4a48e7fdcdb7bd07941ea52030f6f6d3540d989 /pango/pango-layout.c
parent0e76389fbbd4679b39bdc3dd78f6f8701f50b29a (diff)
downloadpango-5b7b3684e18b636bce901688085226694d44adf4.tar.gz
Use shape flags for ellipsis
When shaping the ellipsis, use the same shape flags we use for the rest of the layout, otherwise we end up with subtle size differences between an ellipsized text and a plain …
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r--pango/pango-layout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index df47f0f6..44d59367 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -5819,7 +5819,12 @@ pango_layout_line_postprocess (PangoLayoutLine *line,
if (G_UNLIKELY (state->line_width >= 0 &&
should_ellipsize_current_line (line->layout, state)))
{
- ellipsized = _pango_layout_line_ellipsize (line, state->attrs, state->line_width);
+ PangoShapeFlags shape_flags = PANGO_SHAPE_NONE;
+
+ if (pango_context_get_round_glyph_positions (line->layout->context))
+ shape_flags |= PANGO_SHAPE_ROUND_POSITIONS;
+
+ ellipsized = _pango_layout_line_ellipsize (line, state->attrs, shape_flags, state->line_width);
}
DEBUG ("after removing final space", line, state);