aboutsummaryrefslogtreecommitdiff
path: root/src/Text.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-10 20:40:17 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-10 20:40:17 +0200
commit6f11b42b7015646bcdc5f8bbec7da61e76655861 (patch)
tree364f9bbe02a9f8806a2640f36ebbf8a1da70fdb8 /src/Text.cpp
parent901edef180648ce9c76ec4f73005da6498f57cf0 (diff)
Add ctrl+r keybind to show related videos menu
Diffstat (limited to 'src/Text.cpp')
-rw-r--r--src/Text.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Text.cpp b/src/Text.cpp
index da21b1d..9ec2f68 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -181,6 +181,14 @@ namespace QuickMedia
// Logic loosely based on https://github.com/SFML/SFML/wiki/Source:-CurvedText
void Text::updateGeometry(bool update_even_if_not_dirty)
{
+ if(dirtyText)
+ {
+ textElements.clear();
+ StringViewUtf32 wholeStr(this->str.getData(), this->str.getSize());
+ textElements.push_back({ wholeStr, TextElement::Type::TEXT });
+ dirtyText = false;
+ }
+
if(!update_even_if_not_dirty && !dirty)
return;
@@ -599,14 +607,6 @@ namespace QuickMedia
bool Text::draw(sf::RenderTarget &target)
{
- if(dirtyText)
- {
- textElements.clear();
- StringViewUtf32 wholeStr(this->str.getData(), this->str.getSize());
- textElements.push_back({ wholeStr, TextElement::Type::TEXT });
- dirtyText = false;
- }
-
updateGeometry();
if(dirtyCaret || caretMoveDirection != CaretMoveDirection::NONE)