mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
Merge pull request #83062 from bruvzg/no_dup_es
Do not apply extra spacing twice.
This commit is contained in:
commit
added7d154
@ -212,9 +212,6 @@ void TextEdit::Text::invalidate_cache(int p_line, int p_column, bool p_text_chan
|
||||
for (int i = 0; i < spans; i++) {
|
||||
TS->shaped_set_span_update_font(r, i, font->get_rids(), font_size, font->get_opentype_features());
|
||||
}
|
||||
for (int i = 0; i < TextServer::SPACING_MAX; i++) {
|
||||
TS->shaped_text_set_spacing(r, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i)));
|
||||
}
|
||||
}
|
||||
|
||||
// Apply tab align.
|
||||
|
@ -2907,9 +2907,6 @@ void TextMesh::_create_mesh_array(Array &p_arr) const {
|
||||
|
||||
String txt = (uppercase) ? TS->string_to_upper(xl_text, language) : xl_text;
|
||||
TS->shaped_text_add_string(text_rid, txt, font->get_rids(), font_size, font->get_opentype_features(), language);
|
||||
for (int i = 0; i < TextServer::SPACING_MAX; i++) {
|
||||
TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i)));
|
||||
}
|
||||
|
||||
TypedArray<Vector3i> stt;
|
||||
if (st_parser == TextServer::STRUCTURED_TEXT_CUSTOM) {
|
||||
@ -2927,9 +2924,6 @@ void TextMesh::_create_mesh_array(Array &p_arr) const {
|
||||
for (int i = 0; i < spans; i++) {
|
||||
TS->shaped_set_span_update_font(text_rid, i, font->get_rids(), font_size, font->get_opentype_features());
|
||||
}
|
||||
for (int i = 0; i < TextServer::SPACING_MAX; i++) {
|
||||
TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i)));
|
||||
}
|
||||
|
||||
dirty_font = false;
|
||||
dirty_lines = true;
|
||||
|
@ -200,9 +200,6 @@ void TextLine::set_bidi_override(const Array &p_override) {
|
||||
bool TextLine::add_string(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language, const Variant &p_meta) {
|
||||
ERR_FAIL_COND_V(p_font.is_null(), false);
|
||||
bool res = TS->shaped_text_add_string(rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language, p_meta);
|
||||
for (int i = 0; i < TextServer::SPACING_MAX; i++) {
|
||||
TS->shaped_text_set_spacing(rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i)));
|
||||
}
|
||||
dirty = true;
|
||||
return res;
|
||||
}
|
||||
@ -454,9 +451,6 @@ TextLine::TextLine(const String &p_text, const Ref<Font> &p_font, int p_font_siz
|
||||
rid = TS->create_shaped_text(p_direction, p_orientation);
|
||||
if (p_font.is_valid()) {
|
||||
TS->shaped_text_add_string(rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language);
|
||||
for (int i = 0; i < TextServer::SPACING_MAX; i++) {
|
||||
TS->shaped_text_set_spacing(rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -397,9 +397,6 @@ bool TextParagraph::set_dropcap(const String &p_text, const Ref<Font> &p_font, i
|
||||
TS->shaped_text_clear(dropcap_rid);
|
||||
dropcap_margins = p_dropcap_margins;
|
||||
bool res = TS->shaped_text_add_string(dropcap_rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language);
|
||||
for (int i = 0; i < TextServer::SPACING_MAX; i++) {
|
||||
TS->shaped_text_set_spacing(dropcap_rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i)));
|
||||
}
|
||||
lines_dirty = true;
|
||||
return res;
|
||||
}
|
||||
@ -415,9 +412,6 @@ bool TextParagraph::add_string(const String &p_text, const Ref<Font> &p_font, in
|
||||
_THREAD_SAFE_METHOD_
|
||||
ERR_FAIL_COND_V(p_font.is_null(), false);
|
||||
bool res = TS->shaped_text_add_string(rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language, p_meta);
|
||||
for (int i = 0; i < TextServer::SPACING_MAX; i++) {
|
||||
TS->shaped_text_set_spacing(rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i)));
|
||||
}
|
||||
lines_dirty = true;
|
||||
return res;
|
||||
}
|
||||
@ -1050,9 +1044,6 @@ TextParagraph::TextParagraph(const String &p_text, const Ref<Font> &p_font, int
|
||||
rid = TS->create_shaped_text(p_direction, p_orientation);
|
||||
if (p_font.is_valid()) {
|
||||
TS->shaped_text_add_string(rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language);
|
||||
for (int i = 0; i < TextServer::SPACING_MAX; i++) {
|
||||
TS->shaped_text_set_spacing(rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i)));
|
||||
}
|
||||
}
|
||||
width = p_width;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user