mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Improve justified text alignment
This commit is contained in:
@@ -508,7 +508,7 @@ std::vector<Font::DrawCommand> Font::generateVerticesFormatted(const love::font:
|
||||
auto end = start + range.getSize();
|
||||
float numspaces = std::count(start, end, ' ');
|
||||
if (width < wrap && numspaces >= 1)
|
||||
extraspacing = floorf((wrap - width) / numspaces);
|
||||
extraspacing = (wrap - width) / (numspaces - 1);
|
||||
else
|
||||
extraspacing = 0.0f;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user