Merge pull request #58154 from markdibarry/fix_scroll_to_line

This commit is contained in:
Rémi Verschelde 2022-02-16 14:07:06 +01:00 committed by GitHub
commit fe8f4cebce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3725,7 +3725,7 @@ void RichTextLabel::scroll_to_line(int p_line) {
if ((line_count <= p_line) && (line_count + main->lines[i].text_buf->get_line_count() >= p_line)) {
float line_offset = 0.f;
for (int j = 0; j < p_line - line_count; j++) {
line_offset += main->lines[i].text_buf->get_line_size(j).y;
line_offset += main->lines[i].text_buf->get_line_size(j).y + get_theme_constant(SNAME("line_separation"));
}
vscroll->set_value(main->lines[i].offset.y + line_offset);
return;