diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-11-11 03:59:30 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-11-11 03:59:30 +0000 |
commit | 907b6e21fcb846995cc5b03d2cb1b68fbbc2a2b5 (patch) | |
tree | 3a68163dde9e6008456756fd489185d02e7142f4 /pango | |
parent | ffdc738e9057b9202dc889dd87829dcd90f4d87a (diff) | |
parent | 9a275af8c4cc950a8c277005c99b2282fdf00f79 (diff) | |
download | pango-907b6e21fcb846995cc5b03d2cb1b68fbbc2a2b5.tar.gz |
Merge branch 'fix-hyphen-width' into 'main'
layout: Fix a poblem with hyphen width
See merge request GNOME/pango!500
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pango-layout.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 9e8ce248..1a460d4c 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3792,7 +3792,8 @@ find_break_extra_width (PangoLayout *layout, #if 0 # define DEBUG debug -void +static int pango_layout_line_get_width (PangoLayoutLine *line); +static void debug (const char *where, PangoLayoutLine *line, ParaBreakState *state) { int line_width = pango_layout_line_get_width (line); @@ -3919,10 +3920,10 @@ process_item (PangoLayout *layout, extra_width = 0; for (num_chars = 0; num_chars < item->num_chars; num_chars++) { + extra_width = find_break_extra_width (layout, state, num_chars); + if (width + extra_width > state->remaining_width && break_num_chars < item->num_chars) - { - break; - } + break; /* If there are no previous runs we have to take care to grab at least one char. */ if (can_break_at (layout, state->start_offset + num_chars, retrying_with_char_breaks) && @@ -3931,11 +3932,7 @@ process_item (PangoLayout *layout, break_num_chars = num_chars; break_width = width; break_extra_width = extra_width; - - extra_width = find_break_extra_width (layout, state, num_chars); } - else - extra_width = 0; width += state->log_widths[state->log_widths_offset + num_chars]; } |