From 2c879c34c9aeddae528d2818f7baa6a915d5d77a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 30 Mar 2022 16:14:20 +0200 Subject: Proper y offset for text, add option to create hidden window and add function to make it visible (map, unmap), fix incorrect copy/move text --- src/graphics/Text.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/graphics') diff --git a/src/graphics/Text.cpp b/src/graphics/Text.cpp index fa82a88..a30cdf3 100644 --- a/src/graphics/Text.cpp +++ b/src/graphics/Text.cpp @@ -24,16 +24,15 @@ namespace mgl { Text& Text::operator=(const Text &other) { font = other.font; str = other.str; - mgl_text_init(&text, font ? font->internal_font() : nullptr, str.c_str(), str.size()); - mgl_text_set_position(&text, { other.text.position.x, other.text.position.y }); + text = other.text; + mgl_text_set_string(&text, str.c_str(), str.size()); return *this; } Text::Text(Text &&other) { font = std::move(other.font); - str = std::move(other.str); text = std::move(other.text); - mgl_text_init(&text, font ? font->internal_font() : nullptr, str.c_str(), str.size()); + set_string(std::move(other.str)); other.font = nullptr; other.str.clear(); -- cgit v1.2.3