diff options
author | Rindbee <idleman@yeah.net> | 2023-05-20 22:58:14 +0800 |
---|---|---|
committer | Rindbee <idleman@yeah.net> | 2023-05-20 23:04:20 +0800 |
commit | e5bebbc9ffda8b4fa5a786842ea24f0a3ea0763a (patch) | |
tree | c062546cef61cb369935124af965d72589bea76c /scene/gui/label.cpp | |
parent | 809a98216267f3066b9fec2f02b2042bdc9d3e0d (diff) | |
download | redot-engine-e5bebbc9ffda8b4fa5a786842ea24f0a3ea0763a.tar.gz |
Fix unnecessary break when calculating the height of visible lines
This break causes the minsize to be smaller than expected, and then
the size keeps increasing by one line to cover all visible lines.
This can cause performance issues when there are many visible lines.
Diffstat (limited to 'scene/gui/label.cpp')
-rw-r--r-- | scene/gui/label.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index a9f704e904..7b78477cbc 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -290,9 +290,6 @@ void Label::_update_visible() { int last_line = MIN(lines_rid.size(), lines_visible + lines_skipped); for (int64_t i = lines_skipped; i < last_line; i++) { minsize.height += TS->shaped_text_get_size(lines_rid[i]).y + line_spacing; - if (minsize.height > (get_size().height - style->get_minimum_size().height + line_spacing)) { - break; - } } } |