aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text.cpp b/src/Text.cpp
index bdd41c3..4aaf1c6 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -229,10 +229,10 @@ namespace QuickMedia
sf::Vector2f glyphPos;
sf::Uint32 prevCodePoint = 0;
- size_t lastSpacingWordWrapIndex = -1;
- float lastSpacingAccumulatedOffset = 0.0f;
for(usize textElementIndex = 0; textElementIndex < textElements.size(); ++textElementIndex)
{
+ size_t lastSpacingWordWrapIndex = -1;
+ float lastSpacingAccumulatedOffset = 0.0f;
TextElement &textElement = textElements[textElementIndex];
const sf::Font *ff = font;
size_t vertices_index = 0;
@@ -296,6 +296,8 @@ namespace QuickMedia
}
const sf::Glyph &glyph = ff->getGlyph(codePoint, characterSize, false);
+ // TODO: Fix wrap-around with multiple textElements. Right now it only wrap-arounds within the same textElement, so with mixed latin-japanese it will
+ // wrap at character size rather than at whitespace
if(glyphPos.x + glyph.advance > maxWidth)
{
// If there was a space in the text and text width is too long, then we need to word wrap at space index instead,