summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorhelviett <keltarhelviett@gmail.com>2023-02-22 10:27:13 +0400
committerhelviett <keltarhelviett@gmail.com>2023-02-22 14:17:52 +0400
commitceee405cec171506dde7bc62033dc52ac3797599 (patch)
treea55d24332bd8573548e37ca99b615b5d4bc9c7c4 /scene
parente13fae1414b0369fdd3f51b4e3529fd3f272b0e1 (diff)
Fix visible_lines calculation
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/label.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index b861d7af01..81426158a2 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -209,10 +209,7 @@ bool Label::_shape() {
// Fill after min_size calculation.
- int visible_lines = lines_rid.size();
- if (max_lines_visible >= 0 && visible_lines > max_lines_visible) {
- visible_lines = max_lines_visible;
- }
+ int visible_lines = get_visible_line_count();
if (autowrap_mode != TextServer::AUTOWRAP_OFF) {
bool lines_hidden = visible_lines > 0 && visible_lines < lines_rid.size();
if (lines_hidden) {