diff options
| author | Chia-Hsiang Cheng <gary.chiahsiang.cheng@gmail.com> | 2023-07-23 18:03:38 +0800 |
|---|---|---|
| committer | Chia-Hsiang Cheng <88014292+garychia@users.noreply.github.com> | 2023-08-25 21:07:33 +0800 |
| commit | d66c7a2ac52a43bba99d33eef0bbf42fe795f3d0 (patch) | |
| tree | 0dc412cc9be414aa168223debc68b9d69868cdce | |
| parent | 6f90b23702be158349aa544cf1d6b231600bae92 (diff) | |
| download | redot-engine-d66c7a2ac52a43bba99d33eef0bbf42fe795f3d0.tar.gz | |
Ensure the 'select_all' function selects all items
| -rw-r--r-- | scene/gui/rich_text_label.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 070c79c0ee..2c98cb5a28 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -5304,6 +5304,8 @@ void RichTextLabel::selection_copy() { } void RichTextLabel::select_all() { + _validate_line_caches(); + if (!selection.enabled) { return; } @@ -5316,13 +5318,12 @@ void RichTextLabel::select_all() { if (it->type != ITEM_FRAME) { if (!from_item) { from_item = it; - } else { - to_item = it; } + to_item = it; } it = _get_next_item(it, true); } - if (!from_item || !to_item) { + if (!from_item) { return; } |
