From 7d3e528978ee1a1b5f1e12eaa09ad13fa8b13606 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 3 Aug 2019 16:00:50 -0400 Subject: layout: Use the new glyph rounding option Take the glyph rounding option from PangoContext and translate it into a shape flag. --- pango/pango-layout.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'pango') diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 521f806a..0ddb6e14 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3354,14 +3354,20 @@ shape_run (PangoLayoutLine *line, shape_tab (line, item, glyphs); else { + PangoShapeFlags shape_flags = PANGO_SHAPE_NONE; + + if (pango_context_get_round_glyph_positions (layout->context)) + shape_flags |= PANGO_SHAPE_ROUND_POSITIONS; + if (state->properties.shape_set) _pango_shape_shape (layout->text + item->offset, item->num_chars, state->properties.shape_ink_rect, state->properties.shape_logical_rect, glyphs); else - pango_shape_full (layout->text + item->offset, item->length, - layout->text, layout->length, - &item->analysis, glyphs); + pango_shape_with_flags (layout->text + item->offset, item->length, + layout->text, layout->length, + &item->analysis, glyphs, + shape_flags); if (state->properties.letter_spacing) { -- cgit v1.2.1