Merge pull request #61309 from timothyqiu/label-3d-line-spacing

[3.x] Use float when calculating `Label3D` line height
This commit is contained in:
Rémi Verschelde 2022-05-23 16:10:42 +02:00 committed by GitHub
commit f2e3d89562
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -414,7 +414,7 @@ Ref<TriangleMesh> Label3D::generate_triangle_mesh() const {
const_cast<Label3D *>(this)->regenerate_word_cache(); const_cast<Label3D *>(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; real_t space_w = font->get_char_size(' ').width;
float total_h = line_count * font_h; float total_h = line_count * font_h;
@ -640,7 +640,7 @@ void Label3D::_shape() {
// Generate surfaces and materials. // 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; real_t space_w = font->get_char_size(' ').width;
float total_h = line_count * font_h; float total_h = line_count * font_h;