[pango/rewrite-line-breaking] Correct the extra_width accounting
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/rewrite-line-breaking] Correct the extra_width accounting
- Date: Tue, 16 Nov 2021 23:24:22 +0000 (UTC)
commit 05ea7f4f9905921746fa033a2cd7614148fb8242
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Nov 16 18:22:13 2021 -0500
Correct the extra_width accounting
pango/pango-layout.c | 7 +++++--
1 file 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]