Use extra font spacing in the RichTextLabel line height calculation, and stylebox size in the minimum size calculation.

This commit is contained in:
bruvzg
2021-03-29 17:26:53 +03:00
parent b253aca53f
commit 9f4893c70b
4 changed files with 37 additions and 7 deletions

View File

@@ -98,6 +98,9 @@ void TextParagraph::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_line_underline_position", "line"), &TextParagraph::get_line_underline_position);
ClassDB::bind_method(D_METHOD("get_line_underline_thickness", "line"), &TextParagraph::get_line_underline_thickness);
ClassDB::bind_method(D_METHOD("get_spacing_top"), &TextParagraph::get_spacing_top);
ClassDB::bind_method(D_METHOD("get_spacing_bottom"), &TextParagraph::get_spacing_bottom);
ClassDB::bind_method(D_METHOD("get_dropcap_size"), &TextParagraph::get_dropcap_size);
ClassDB::bind_method(D_METHOD("get_dropcap_lines"), &TextParagraph::get_dropcap_lines);
@@ -266,6 +269,14 @@ bool TextParagraph::add_string(const String &p_text, const Ref<Font> &p_fonts, i
return res;
}
int TextParagraph::get_spacing_top() const {
return spacing_top;
}
int TextParagraph::get_spacing_bottom() const {
return spacing_bottom;
}
void TextParagraph::_set_bidi_override(const Array &p_override) {
Vector<Vector2i> overrides;
for (int i = 0; i < p_override.size(); i++) {