Merge pull request #107338 from TelePete/label-ratio-fix
Fix visible ratio when displaying all characters in Label
This commit is contained in:
commit
6181a0c756
1 changed files with 3 additions and 3 deletions
|
|
@ -1269,10 +1269,10 @@ String Label::get_text() const {
|
|||
void Label::set_visible_characters(int p_amount) {
|
||||
if (visible_chars != p_amount) {
|
||||
visible_chars = p_amount;
|
||||
if (get_total_character_count() > 0) {
|
||||
visible_ratio = (float)p_amount / (float)get_total_character_count();
|
||||
} else {
|
||||
if (p_amount == -1 || get_total_character_count() == 0) {
|
||||
visible_ratio = 1.0;
|
||||
} else {
|
||||
visible_ratio = (float)p_amount / (float)get_total_character_count();
|
||||
}
|
||||
if (visible_chars_behavior == TextServer::VC_CHARS_BEFORE_SHAPING) {
|
||||
text_dirty = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue