Merge pull request #40217 from theoway/visible_line_count_fix

Fixes the get_visible_line_count() of rich text label
This commit is contained in:
Rémi Verschelde 2020-07-22 09:50:26 +02:00 committed by GitHub
commit 1ab0644532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1020,7 +1020,8 @@ void RichTextLabel::_notification(int p_what) {
visible_line_count = 0; visible_line_count = 0;
while (y < size.height && from_line < main->lines.size()) { while (y < size.height && from_line < main->lines.size()) {
visible_line_count += _process_line(main, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, from_line, PROCESS_DRAW, base_font, base_color, font_color_shadow, use_outline, shadow_ofs, Point2i(), nullptr, nullptr, nullptr, total_chars); visible_line_count++;
_process_line(main, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, from_line, PROCESS_DRAW, base_font, base_color, font_color_shadow, use_outline, shadow_ofs, Point2i(), nullptr, nullptr, nullptr, total_chars);
total_chars += main->lines[from_line].char_count; total_chars += main->lines[from_line].char_count;
from_line++; from_line++;