summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-04 12:59:02 +0200
committerGitHub <noreply@github.com>2021-05-04 12:59:02 +0200
commit56316b27ab97acb3ce1a318ba3466c31489a1322 (patch)
treefacbb3116dd4e6d7f5d6c1e100bd1a18be1c3a6b /scene/gui
parent9a8ef54b5a0af343989de7dc01c6b486a523afb7 (diff)
parent77fd9e4dd332e01e1f6df8eaa3446ffb5aa46798 (diff)
Merge pull request #41321 from EricEzaM/output-log-enhancements
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/rich_text_label.cpp7
-rw-r--r--scene/gui/rich_text_label.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index c763ae6bd6..843e7ef6e2 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -2612,6 +2612,13 @@ void RichTextLabel::pop() {
current = current->parent;
}
+// Creates a new line without adding an ItemNewline to the previous line.
+// Useful when wanting to calling remove_line and add a new line immediately after.
+void RichTextLabel::increment_line_count() {
+ current_frame->lines.resize(current_frame->lines.size() + 1);
+ _invalidate_current_line(current_frame);
+}
+
void RichTextLabel::clear() {
main->_clear_children();
current = main;
diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h
index e3e457d1f2..afc88e070a 100644
--- a/scene/gui/rich_text_label.h
+++ b/scene/gui/rich_text_label.h
@@ -483,6 +483,8 @@ public:
void push_cell();
void pop();
+ void increment_line_count();
+
void clear();
void set_offset(int p_pixel);