diff --git a/components/Editor.h b/components/Editor.h index 27dc205..8d68d62 100644 --- a/components/Editor.h +++ b/components/Editor.h @@ -123,8 +123,6 @@ public: void setFocus(bool focusStatus) { BaseComponent::setFocus(focusStatus); cursor_.setVisibility(focusStatus); - - draw(); } void onKeyPress(int key) override { @@ -242,8 +240,6 @@ public: moveRight(); } } - - draw(); } }; diff --git a/components/Text.h b/components/Text.h index 37091f9..673483f 100644 --- a/components/Text.h +++ b/components/Text.h @@ -16,16 +16,6 @@ private: int maxLineWidth_ = 0; public: - Text(int left, int top, int width, int height) : BaseComponent(top, left, width, height) { - text_ = RichText(); - } - Text(int left, int top, int width, int height, const RichText& text) : BaseComponent(top, left, width, height) { - text_ = text; - } - ~Text() override { - lines_.clear(); - } - void setText(const RichText& text) { this->text_ = text; @@ -70,6 +60,20 @@ public: // } } + Text() : BaseComponent(0, 0, 0, 0) { + setText(RichText()); + } + + Text(int left, int top, int width, int height) : BaseComponent(left, top, width, height) { + setText(RichText()); + } + Text(int left, int top, int width, int height, const RichText& text) : BaseComponent(left, top, width, height) { + setText(text); + } + ~Text() override { + lines_.clear(); + } + RichText getText() { return text_; }