|
@@ -3677,6 +3677,7 @@ void RichTextLabel::set_percent_visible(float p_percent) {
|
|
}
|
|
}
|
|
main->first_invalid_line = 0; //invalidate ALL
|
|
main->first_invalid_line = 0; //invalidate ALL
|
|
_validate_line_caches(main);
|
|
_validate_line_caches(main);
|
|
|
|
+ _change_notify("visible_characters");
|
|
update();
|
|
update();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3890,6 +3891,15 @@ void RichTextLabel::_bind_methods() {
|
|
|
|
|
|
void RichTextLabel::set_visible_characters(int p_visible) {
|
|
void RichTextLabel::set_visible_characters(int p_visible) {
|
|
visible_characters = p_visible;
|
|
visible_characters = p_visible;
|
|
|
|
+ if (p_visible == -1) {
|
|
|
|
+ percent_visible = 1;
|
|
|
|
+ } else {
|
|
|
|
+ int total_char_count = get_total_character_count();
|
|
|
|
+ if (total_char_count > 0) {
|
|
|
|
+ percent_visible = (float)p_visible / (float)total_char_count;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ _change_notify("percent_visible");
|
|
update();
|
|
update();
|
|
}
|
|
}
|
|
|
|
|