[Bf-blender-cvs] [83d9ba341e5] blender-v2.83-release: Fix T75965: Scale to Fit Text Box fails with a single word

Campbell Barton noreply at git.blender.org
Thu Apr 23 07:08:43 CEST 2020


Commit: 83d9ba341e5a31c9edaae00786e8b461c62d5c5f
Author: Campbell Barton
Date:   Thu Apr 23 15:03:47 2020 +1000
Branches: blender-v2.83-release
https://developer.blender.org/rB83d9ba341e5a31c9edaae00786e8b461c62d5c5f

Fix T75965: Scale to Fit Text Box fails with a single word

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

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

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

diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index e8ff2ccc1af..92eb6ea03e2 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -1501,9 +1501,9 @@ static bool vfont_to_curve(Object *ob,
       }
       else if (tb_scale.h == 0.0f) {
         /* This is a horizontal overflow. */
-        if (lnr > 1) {
+        if (longest_line_length != 0.0f) {
           /* We make sure longest line before it broke can fit here. */
-          float scale_to_fit = tb_scale.w / (longest_line_length);
+          float scale_to_fit = tb_scale.w / longest_line_length;
           scale_to_fit -= FLT_EPSILON;
 
           iter_data->scale_to_fit = scale_to_fit;



More information about the Bf-blender-cvs mailing list