From d52aa9ec30e74b593eee80082bf8f27bea08246f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Dec 2009 16:02:34 +0100 Subject: [PATCH] Always recalculate run width after breaking the run Before we only did this if justifying. However, computing the width is essentially free these days, so do it always. --- pango/pango-layout.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index df8207c..f78fbb4 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3352,17 +3352,11 @@ process_item (PangoLayout *layout, length = g_utf8_offset_to_pointer (layout->text + item->offset, break_num_chars) - (layout->text + item->offset); new_item = pango_item_split (item, length, break_num_chars); - - /* reshaping may slightly change the item width. update - * remaining_width if we are justifying */ + /* Add the width back, to the line, reshape, subtract the new width */ state->remaining_width += break_width; - insert_run (line, state, new_item, FALSE); - - if (layout->justify) - break_width = pango_glyph_string_get_width (((PangoGlyphItem *)(line->runs->data))->glyphs); - + break_width = pango_glyph_string_get_width (((PangoGlyphItem *)(line->runs->data))->glyphs); state->remaining_width -= break_width; state->log_widths_offset += break_num_chars; -- 2.7.4