Browse Source

Fix font vertex generation skipping the first glyph in the string if it restarts its loop due to its texture atlas being recreated to make room for more glyphs. Resolves issue #1452.

Alex Szpakowski 6 years ago
parent
commit
752c5b70f1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modules/graphics/Font.cpp

+ 1 - 1
src/modules/graphics/Font.cpp

@@ -456,7 +456,7 @@ std::vector<Font::DrawCommand> Font::generateVertices(const ColoredCodepoints &c
 		// If findGlyph invalidates the texture cache, re-start the loop.
 		// If findGlyph invalidates the texture cache, re-start the loop.
 		if (cacheid != textureCacheID)
 		if (cacheid != textureCacheID)
 		{
 		{
-			i = 0;
+			i = -1; // The next iteration will increment this to 0.
 			maxwidth = 0;
 			maxwidth = 0;
 			dx = offset.x;
 			dx = offset.x;
 			dy = offset.y;
 			dy = offset.y;