diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-18 12:17:31 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-18 12:17:31 +0100 |
commit | 8b020f5be8fbd3741085849fccd5c958cf260d2b (patch) | |
tree | e478b28007b4e3605489a0ebabc73f4d4a6f6fa5 | |
parent | a2ac8b537a61fb7a7be1a3e08635ffc88e17d966 (diff) |
Move glyph creation for text to render function instead of in set string, clear font glyph background before rendering the text
m--------- | depends/mgl | 0 | ||||
-rw-r--r-- | include/mglpp/graphics/Text.hpp | 2 | ||||
-rw-r--r-- | src/graphics/Text.cpp | 2 |
3 files changed, 2 insertions, 2 deletions
diff --git a/depends/mgl b/depends/mgl -Subproject ff6d302d7b0ef4c32dca6e2d0ce12927d517875 +Subproject f4833afa1afa56def5a6d54fa8ce22d3a9b4eb5 diff --git a/include/mglpp/graphics/Text.hpp b/include/mglpp/graphics/Text.hpp index 648ecac..5126eab 100644 --- a/include/mglpp/graphics/Text.hpp +++ b/include/mglpp/graphics/Text.hpp @@ -25,7 +25,7 @@ namespace mgl { void set_color(Color color) override; vec2f get_position() const override; - FloatRect get_bounds() const; + FloatRect get_bounds(); void set_string(std::string str); const std::string& get_string() const; void append_string(const std::string &str); diff --git a/src/graphics/Text.cpp b/src/graphics/Text.cpp index ad6fed2..fa82a88 100644 --- a/src/graphics/Text.cpp +++ b/src/graphics/Text.cpp @@ -56,7 +56,7 @@ namespace mgl { return { text.position.x, text.position.y }; } - FloatRect Text::get_bounds() const { + FloatRect Text::get_bounds() { mgl_vec2f bounds = mgl_text_get_bounds(&text); FloatRect rect(get_position(), { bounds.x, bounds.y }); return rect; |