summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-08-20 23:24:42 +0200
committerGitHub <noreply@github.com>2021-08-20 23:24:42 +0200
commit2daef0400a95bb467dacff845052a27e464e4dec (patch)
tree2dadd6e226858be1f465eabff196b50f75317a8b
parent78bf06ea415873d336f7869edb632968b1be6bed (diff)
parent39b90802d06d102f9494404d181ed6eac4590f17 (diff)
Merge pull request #51866 from requizm/fix/49455
Fix `line_separation` working incorrectly in `RichTextLabel`
-rw-r--r--doc/classes/RichTextLabel.xml2
-rw-r--r--scene/gui/rich_text_label.cpp2
-rw-r--r--scene/resources/default_theme/default_theme.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index 7bbcc5e0b5..e77232a613 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -555,7 +555,7 @@
<theme_item name="italics_font_size" data_type="font_size" type="int">
The font size used for italics text.
</theme_item>
- <theme_item name="line_separation" data_type="constant" type="int" default="1">
+ <theme_item name="line_separation" data_type="constant" type="int" default="0">
The vertical space between lines.
</theme_item>
<theme_item name="mono_font" data_type="font" type="Font">
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index cf2a1481a1..32fa7cc045 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -1435,7 +1435,7 @@ void RichTextLabel::_notification(int p_what) {
while (ofs.y < size.height && from_line < main->lines.size()) {
visible_paragraph_count++;
visible_line_count += _draw_line(main, from_line, ofs, text_rect.size.x, base_color, outline_size, outline_color, font_shadow_color, use_outline, shadow_ofs);
- ofs.y += main->lines[from_line].text_buf->get_size().y;
+ ofs.y += main->lines[from_line].text_buf->get_size().y + get_theme_constant(SNAME("line_separation"));
from_line++;
}
} break;
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 5f70a31844..4e139adabb 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -917,7 +917,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("shadow_offset_y", "RichTextLabel", 1 * scale);
theme->set_constant("shadow_as_outline", "RichTextLabel", 0 * scale);
- theme->set_constant("line_separation", "RichTextLabel", 1 * scale);
+ theme->set_constant("line_separation", "RichTextLabel", 0 * scale);
theme->set_constant("table_hseparation", "RichTextLabel", 3 * scale);
theme->set_constant("table_vseparation", "RichTextLabel", 3 * scale);