diff options
author | Campbell Barton <campbell@blender.org> | 2022-02-24 04:19:17 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-02-24 04:19:17 +0300 |
commit | affed12bb9d93e3257c7608470f96ed1e4dec68d (patch) | |
tree | be13a012998d9f2a5b3c671e96d1d01fe964a928 /source/blender | |
parent | f8fe0e831ec14cc521e03df6b586918a6a5add03 (diff) | |
parent | c9582b2752c8e016f128f71a530cab283ba26f64 (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/vfont.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/vfont.c b/source/blender/blenkernel/intern/vfont.c index 5f1bb7db231..7e025c59b6c 100644 --- a/source/blender/blenkernel/intern/vfont.c +++ b/source/blender/blenkernel/intern/vfont.c @@ -985,7 +985,22 @@ static bool vfont_to_curve(Object *ob, } else if (x_used > x_available) { // CLOG_WARN(&LOG, "linewidth exceeded: %c%c%c...", mem[i], mem[i+1], mem[i+2]); - for (j = i; j && (mem[j] != '\n') && (chartransdata[j].dobreak == 0); j--) { + for (j = i; (mem[j] != '\n') && (chartransdata[j].dobreak == 0); j--) { + + /* Special case when there are no breaks possible. */ + if (UNLIKELY(j == 0)) { + if (i == slen) { + /* Use the behavior of zero a height text-box when a break cannot be inserted. + * + * Typically when a text-box has any height and overflow is set to scale + * the text will wrap to fit the width as necessary. When wrapping isn't + * possible it's important to use the same code-path as zero-height lines. + * Without this exception a single word will not scale-to-fit (see: T95116). */ + tb_scale.h = 0.0f; + } + break; + } + bool dobreak = false; if (ELEM(mem[j], ' ', '-')) { ct -= (i - (j - 1)); |