summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-11-16 18:22:13 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-11-16 18:22:13 -0500
commit05ea7f4f9905921746fa033a2cd7614148fb8242 (patch)
tree01290b0f0c08ff035a8238ba82178290b79dafcd
parentc8b2c31348361f7549d2ee3399fdb1a98ca76f9b (diff)
downloadpango-05ea7f4f9905921746fa033a2cd7614148fb8242.tar.gz
Correct the extra_width accounting
-rw-r--r--pango/pango-layout.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 4360e973..1e8f1087 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -4039,8 +4039,11 @@ retry_break:
new_break_width = pango_glyph_string_get_width (glyphs);
- if (new_item->analysis.flags & PANGO_ANALYSIS_FLAG_NEED_HYPHEN)
- new_break_width -= extra_width;
+ if (num_chars > 0 &&
+ layout->log_attrs[state->start_offset + num_chars - 1].is_white)
+ extra_width = - state->log_widths[state->log_widths_offset + num_chars - 1];
+ else
+ extra_width = 0;
g_debug ("measured breakpoint %d: %d", num_chars, new_break_width);