aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text.cpp39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/Text.cpp b/src/Text.cpp
index 18a87f4..39e5bc4 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -21,6 +21,26 @@ namespace QuickMedia
static const size_t FONT_INDEX_SYMBOLS = 2;
static const size_t FONT_INDEX_EMOJI = 3;
static const size_t FONT_ARRAY_SIZE = 4;
+
+ Text::Text() :
+ bold_font(false),
+ characterSize(12),
+ maxWidth(0.0f),
+ color(get_theme().text_color),
+ dirty(true),
+ dirtyText(true),
+ dirtyCaret(true),
+ editable(false),
+ highlight_urls(false),
+ caretMoveDirection(CaretMoveDirection::NONE),
+ num_lines(1),
+ lineSpacing(0.0f),
+ characterSpacing(0.0f),
+ caretIndex(0),
+ caret_offset_x(0.0f)
+ {
+
+ }
Text::Text(std::string _str, bool bold_font, unsigned int characterSize, float maxWidth, bool highlight_urls) :
bold_font(bold_font),
@@ -28,8 +48,8 @@ namespace QuickMedia
maxWidth(maxWidth),
color(get_theme().text_color),
dirty(true),
- dirtyText(false),
- dirtyCaret(false),
+ dirtyText(true),
+ dirtyCaret(true),
editable(false),
highlight_urls(highlight_urls),
caretMoveDirection(CaretMoveDirection::NONE),
@@ -41,6 +61,21 @@ namespace QuickMedia
{
setString(std::move(_str));
}
+
+ Text::Text(const Text &other) : Text(other.str, other.bold_font, other.characterSize, other.maxWidth, other.highlight_urls) {
+
+ }
+
+ Text& Text::operator=(const Text &other) {
+ str = other.str;
+ bold_font = other.bold_font;
+ characterSize = other.characterSize;
+ maxWidth = other.maxWidth;
+ highlight_urls = other.highlight_urls;
+ caretIndex = other.caretIndex;
+ position = other.position;
+ return *this;
+ }
void Text::setString(std::string str)
{