[Bf-blender-cvs] [213445e3896] master: Fix T66614: Text objects: Truncate overflow for non-top aligned text

Dalai Felinto noreply at git.blender.org
Mon Sep 21 10:02:16 CEST 2020


Commit: 213445e3896922c2278fc7cdcb74d8ca13fa6a3e
Author: Dalai Felinto
Date:   Mon Sep 21 17:49:15 2020 +1000
Branches: master
https://developer.blender.org/rB213445e3896922c2278fc7cdcb74d8ca13fa6a3e

Fix T66614: Text objects: Truncate overflow for non-top aligned text

===================================================================

M	source/blender/blenkernel/intern/font.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list