diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-07 08:25:36 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-07 08:25:36 +0100 |
commit | 01e3403abf86050e4096ecf60466de4139ac78e2 (patch) | |
tree | 0e55dfc60060a75f3810e985a8394a41b4012cfd /include | |
parent | 29627a93c68b9f3927ee9d1097ed3266777b6a0b (diff) |
Fix text rendering getting corrupt at copy/move constructor
Diffstat (limited to 'include')
-rw-r--r-- | include/mglpp/graphics/Text.hpp | 3 | ||||
-rw-r--r-- | include/mglpp/window/Event.hpp | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/mglpp/graphics/Text.hpp b/include/mglpp/graphics/Text.hpp index 6166087..648ecac 100644 --- a/include/mglpp/graphics/Text.hpp +++ b/include/mglpp/graphics/Text.hpp @@ -17,6 +17,8 @@ namespace mgl { Text(std::string str, Font &font); Text(std::string str, vec2f position, Font &font); Text(const Text &other); + Text& operator=(const Text &other); + Text(Text &&other); ~Text(); void set_position(vec2f position) override; @@ -26,6 +28,7 @@ namespace mgl { FloatRect get_bounds() const; void set_string(std::string str); const std::string& get_string() const; + void append_string(const std::string &str); // Returns the visual position of a character from its index. // If the index is out of range, then the position of the end of the string is returned. diff --git a/include/mglpp/window/Event.hpp b/include/mglpp/window/Event.hpp index 5b7da45..5b9e357 100644 --- a/include/mglpp/window/Event.hpp +++ b/include/mglpp/window/Event.hpp @@ -17,6 +17,8 @@ namespace mgl { struct TextEvent { uint32_t codepoint; + int size; + char str[5]; /* utf8, null terminated */ }; struct KeyEvent { |