diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-22 22:44:01 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-22 22:44:55 +0100 |
commit | d66f6b3b04f4d9e01b21466cb4c6497fbad204d8 (patch) | |
tree | bb443dae9ed2ad56d25879131ad34b83d720892d /scene/gui | |
parent | 999bb91dc670882742bb28c698297f110ca3fd0b (diff) |
Revert "Fix visible_lines calculation"
This reverts commit ceee405cec171506dde7bc62033dc52ac3797599.
This caused regressions, see #73736 and #73780.
Fixes #73780.
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/label.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 81426158a2..b861d7af01 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -209,7 +209,10 @@ bool Label::_shape() { // Fill after min_size calculation. - int visible_lines = get_visible_line_count(); + int visible_lines = lines_rid.size(); + if (max_lines_visible >= 0 && visible_lines > max_lines_visible) { + visible_lines = max_lines_visible; + } if (autowrap_mode != TextServer::AUTOWRAP_OFF) { bool lines_hidden = visible_lines > 0 && visible_lines < lines_rid.size(); if (lines_hidden) { |