summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-23 19:42:09 +0200
committerGitHub <noreply@github.com>2022-05-23 19:42:09 +0200
commit3fb1f258bea0ca733af8ac133a686cf63e23069f (patch)
tree47209d0ad185af0872ce2ad0a90e2fc229f32def
parent4f43739684314a791b34a115e7fc51de4fcec2c6 (diff)
parent4e86c13557a58cdc942cccc86aa66313737b8792 (diff)
Merge pull request #61327 from bruvzg/text_mesh_non_visual
-rw-r--r--scene/resources/primitive_meshes.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp
index fb9b2823b4..6805dfbb86 100644
--- a/scene/resources/primitive_meshes.cpp
+++ b/scene/resources/primitive_meshes.cpp
@@ -2402,6 +2402,10 @@ void TextMesh::_create_mesh_array(Array &p_arr) const {
Vector2 offset_pre = offset;
for (int i = 0; i < gl_size; i++) {
+ if (glyphs[i].index == 0) {
+ offset.x += glyphs[i].advance * pixel_size * glyphs[i].repeat;
+ continue;
+ }
if (glyphs[i].font_rid != RID()) {
uint32_t hash = hash_one_uint64(glyphs[i].font_rid.get_id());
hash = hash_djb2_one_32(glyphs[i].index, hash);
@@ -2457,6 +2461,10 @@ void TextMesh::_create_mesh_array(Array &p_arr) const {
int32_t p_idx = 0;
int32_t i_idx = 0;
for (int i = 0; i < gl_size; i++) {
+ if (glyphs[i].index == 0) {
+ offset.x += glyphs[i].advance * pixel_size * glyphs[i].repeat;
+ continue;
+ }
if (glyphs[i].font_rid != RID()) {
uint32_t hash = hash_one_uint64(glyphs[i].font_rid.get_id());
hash = hash_djb2_one_32(glyphs[i].index, hash);