diff options
author | Dalai Felinto <dalai@blender.org> | 2020-09-21 10:49:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-21 11:00:36 +0300 |
commit | 213445e3896922c2278fc7cdcb74d8ca13fa6a3e (patch) | |
tree | 7913d35c3ccedf20d1a1e3918b3f46a4785c6576 /source/blender/blenkernel | |
parent | 701c3e499f61f9400b5f1c570fbbe04dfa21f158 (diff) |
Fix T66614: Text objects: Truncate overflow for non-top aligned text
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/font.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 88d91cf5640..124e53b4008 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -1188,6 +1188,14 @@ static bool vfont_to_curve(Object *ob, ct_last = chartransdata + (is_last_filled_textbox ? slen : i_textbox_next - 1); lines = ct_last->linenr - ct_first->linenr + 1; + if (cu->overflow == CU_OVERFLOW_TRUNCATE) { + /* Ensure overflow doesn't truncate text, before centering vertically + * giving odd/buggy results, see: T66614. */ + if ((tb_index == cu->totbox - 1) && (last_line != -1)) { + lines = last_line - ct_first->linenr; + } + } + textbox_scale(&tb_scale, &cu->tb[tb_index], 1.0f / font_size); /* The initial Y origin of the textbox is hardcoded to 1.0f * text scale. */ const float textbox_y_origin = 1.0f; |