[pango] Always recalculate run width after breaking the run
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pango] Always recalculate run width after breaking the run
- Date: Fri, 25 Dec 2009 18:23:31 +0000 (UTC)
commit d52aa9ec30e74b593eee80082bf8f27bea08246f
Author: Behdad Esfahbod <behdad behdad org>
Date: Fri Dec 25 16:02:34 2009 +0100
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 files 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]