From ff5e671c8125f75abbe5209b543a7291eb8f99c7 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 23 May 2022 17:58:51 +0800 Subject: [PATCH] Use float when calculating Label3D line height --- scene/3d/label_3d.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/3d/label_3d.cpp b/scene/3d/label_3d.cpp index 4a2c50e3d64..6542ec8ce54 100644 --- a/scene/3d/label_3d.cpp +++ b/scene/3d/label_3d.cpp @@ -414,7 +414,7 @@ Ref Label3D::generate_triangle_mesh() const { const_cast(this)->regenerate_word_cache(); } - int font_h = font->get_height() + line_spacing; + float font_h = font->get_height() + line_spacing; real_t space_w = font->get_char_size(' ').width; float total_h = line_count * font_h; @@ -640,7 +640,7 @@ void Label3D::_shape() { // Generate surfaces and materials. - int font_h = font->get_height() + line_spacing; + float font_h = font->get_height() + line_spacing; real_t space_w = font->get_char_size(' ').width; float total_h = line_count * font_h;