[TextMesh, 3.x] Fix auto-translation and ignore control chars.
This commit is contained in:
parent
6a99678bc6
commit
efa6b01c97
|
@ -664,6 +664,12 @@ void MeshInstance::_notification(int p_what) {
|
||||||
_resolve_skeleton_path();
|
_resolve_skeleton_path();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (p_what == NOTIFICATION_TRANSLATION_CHANGED) {
|
||||||
|
if (mesh.is_valid()) {
|
||||||
|
mesh->notification(NOTIFICATION_TRANSLATION_CHANGED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||||
if (skin_ref.is_valid() && mesh.is_valid() && _is_software_skinning_enabled()) {
|
if (skin_ref.is_valid() && mesh.is_valid() && _is_software_skinning_enabled()) {
|
||||||
ERR_FAIL_COND(!skin_ref->get_skeleton_node());
|
ERR_FAIL_COND(!skin_ref->get_skeleton_node());
|
||||||
|
|
|
@ -1987,7 +1987,7 @@ void TextMesh::_create_mesh_array(Array &p_arr) const {
|
||||||
if ((c & 0xfffffc00) == 0xdc00) { // skip trail surrogate.
|
if ((c & 0xfffffc00) == 0xdc00) { // skip trail surrogate.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (utf32_char >= 0x20) {
|
||||||
_generate_glyph_mesh_data(utf32_char, font, c, n);
|
_generate_glyph_mesh_data(utf32_char, font, c, n);
|
||||||
GlyphMeshData &gl_data = cache[utf32_char];
|
GlyphMeshData &gl_data = cache[utf32_char];
|
||||||
|
|
||||||
|
@ -2005,6 +2005,7 @@ void TextMesh::_create_mesh_array(Array &p_arr) const {
|
||||||
min_p.y = MIN(gl_data.min_p.y + offset_pre.y, min_p.y);
|
min_p.y = MIN(gl_data.min_p.y + offset_pre.y, min_p.y);
|
||||||
max_p.x = MAX(gl_data.max_p.x + offset_pre.x, max_p.x);
|
max_p.x = MAX(gl_data.max_p.x + offset_pre.x, max_p.x);
|
||||||
max_p.y = MAX(gl_data.max_p.y + offset_pre.y, max_p.y);
|
max_p.y = MAX(gl_data.max_p.y + offset_pre.y, max_p.y);
|
||||||
|
}
|
||||||
|
|
||||||
offset_pre.x += font->get_char_size(c, n).x * pixel_size;
|
offset_pre.x += font->get_char_size(c, n).x * pixel_size;
|
||||||
}
|
}
|
||||||
|
@ -2041,6 +2042,7 @@ void TextMesh::_create_mesh_array(Array &p_arr) const {
|
||||||
if ((c & 0xfffffc00) == 0xdc00) { // skip trail surrogate.
|
if ((c & 0xfffffc00) == 0xdc00) { // skip trail surrogate.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (utf32_char >= 0x20) {
|
||||||
_generate_glyph_mesh_data(utf32_char, font, c, n);
|
_generate_glyph_mesh_data(utf32_char, font, c, n);
|
||||||
GlyphMeshData &gl_data = cache[utf32_char];
|
GlyphMeshData &gl_data = cache[utf32_char];
|
||||||
|
|
||||||
|
@ -2135,6 +2137,7 @@ void TextMesh::_create_mesh_array(Array &p_arr) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
offset.x += font->get_char_size(c, n).x * pixel_size;
|
offset.x += font->get_char_size(c, n).x * pixel_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue