We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 86408d1 + a4ba3d5 commit 6181a0cCopy full SHA for 6181a0c
scene/gui/label.cpp
@@ -1269,10 +1269,10 @@ String Label::get_text() const {
1269
void Label::set_visible_characters(int p_amount) {
1270
if (visible_chars != p_amount) {
1271
visible_chars = p_amount;
1272
- if (get_total_character_count() > 0) {
1273
- visible_ratio = (float)p_amount / (float)get_total_character_count();
1274
- } else {
+ if (p_amount == -1 || get_total_character_count() == 0) {
1275
visible_ratio = 1.0;
+ } else {
+ visible_ratio = (float)p_amount / (float)get_total_character_count();
1276
}
1277
if (visible_chars_behavior == TextServer::VC_CHARS_BEFORE_SHAPING) {
1278
text_dirty = true;
0 commit comments