summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Deurwaarder <william.git@xs4all.nl>2021-09-02 22:06:54 +0200
committerWilliam Deurwaarder <william.git@xs4all.nl>2021-09-02 22:11:14 +0200
commitb54b0bc5803ddd269887e2cf24fc4b1d2880d0a1 (patch)
tree30bc73fb17f274b73a51ec43edea4332669b1ebf
parentb73e7623c82f27f6327922217ad72198223a7109 (diff)
Fix documentation viewer to scroll to end
Extra `line separation` height was not taken into account when the offset for the different paragraphs (lines) was calculated.
-rw-r--r--scene/gui/rich_text_label.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index fbc67d8a24..126b0dfd30 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -366,7 +366,7 @@ void RichTextLabel::_resize_line(ItemFrame *p_frame, int p_line, const Ref<Font>
}
if (p_line > 0) {
- l.offset.y = p_frame->lines[p_line - 1].offset.y + p_frame->lines[p_line - 1].text_buf->get_size().y;
+ l.offset.y = p_frame->lines[p_line - 1].offset.y + p_frame->lines[p_line - 1].text_buf->get_size().y + get_theme_constant(SNAME("line_separation"));
} else {
l.offset.y = 0;
}
@@ -614,7 +614,7 @@ void RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font>
*r_char_offset = l.char_offset + l.char_count;
if (p_line > 0) {
- l.offset.y = p_frame->lines[p_line - 1].offset.y + p_frame->lines[p_line - 1].text_buf->get_size().y;
+ l.offset.y = p_frame->lines[p_line - 1].offset.y + p_frame->lines[p_line - 1].text_buf->get_size().y + get_theme_constant(SNAME("line_separation"));
} else {
l.offset.y = 0;
}