Merge pull request #116196 from bruvzg/shy_b
Fix soft hyphen not working with small (or zero) line breaking width.
This commit is contained in:
commit
a142c2218a
1 changed files with 2 additions and 2 deletions
|
|
@ -977,7 +977,7 @@ PackedInt32Array TextServer::shaped_text_get_line_breaks_adv(const RID &p_shaped
|
|||
if ((l_gl[i].flags & GRAPHEME_IS_SOFT_HYPHEN) == GRAPHEME_IS_SOFT_HYPHEN) {
|
||||
uint32_t gl = font_get_glyph_index(l_gl[i].font_rid, l_gl[i].font_size, 0x00ad, 0);
|
||||
float w = font_get_glyph_advance(l_gl[i].font_rid, l_gl[i].font_size, gl)[(orientation == ORIENTATION_HORIZONTAL) ? 0 : 1];
|
||||
if (width + adv + w <= p_width[chunk]) {
|
||||
if (width + adv + w <= p_width[chunk] || w >= p_width[chunk]) {
|
||||
last_safe_break = i;
|
||||
word_count++;
|
||||
}
|
||||
|
|
@ -1161,7 +1161,7 @@ PackedInt32Array TextServer::shaped_text_get_line_breaks(const RID &p_shaped, do
|
|||
if ((l_gl[i].flags & GRAPHEME_IS_SOFT_HYPHEN) == GRAPHEME_IS_SOFT_HYPHEN) {
|
||||
uint32_t gl = font_get_glyph_index(l_gl[i].font_rid, l_gl[i].font_size, 0x00AD, 0);
|
||||
float w = font_get_glyph_advance(l_gl[i].font_rid, l_gl[i].font_size, gl)[(orientation == ORIENTATION_HORIZONTAL) ? 0 : 1];
|
||||
if (width + adv + w <= p_width) {
|
||||
if (width + adv + w <= p_width || w >= p_width) {
|
||||
last_safe_break = i;
|
||||
word_count++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue