mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Fixed justify printf Align Mode (issue #635)
This commit is contained in:
@@ -818,7 +818,7 @@ void Graphics::printf(const std::string &str, float x, float y, float wrap, Alig
|
|||||||
currentFont->print(*line_iter, ceil(x + (wrap - width) / 2), ceil(y), 0.0f);
|
currentFont->print(*line_iter, ceil(x + (wrap - width) / 2), ceil(y), 0.0f);
|
||||||
break;
|
break;
|
||||||
case ALIGN_JUSTIFY:
|
case ALIGN_JUSTIFY:
|
||||||
if (line_iter->length() > 1 && (line_iter+1) != line_end)
|
if (line_iter->length() > 1)
|
||||||
letter_spacing = (wrap - width) / float(line_iter->length() - 1);
|
letter_spacing = (wrap - width) / float(line_iter->length() - 1);
|
||||||
else
|
else
|
||||||
letter_spacing = 0.0f;
|
letter_spacing = 0.0f;
|
||||||
|
|||||||
Reference in New Issue
Block a user