diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-18 06:20:56 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-18 06:20:56 +0100 |
commit | 8765ee0f90be145ad73a6a912c8df6ebb16dd963 (patch) | |
tree | 476f516422f730401bab3c24dd44e4957a23c61d /src | |
parent | 65fd232e102ff89564d5417771e94bed3d1d31c7 (diff) |
Fix corrupt reactions in matrix (use of deleted vertex buffer)
Diffstat (limited to 'src')
-rw-r--r-- | src/Text.cpp | 39 |
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) { |