mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
Correctly set the spacing for the last character in an ImageFont as well
This commit is contained in:
@@ -131,6 +131,16 @@ void ImageRasterizer::load()
|
||||
widths[c] = (end - start);
|
||||
}
|
||||
|
||||
// Find spacing of last glyph
|
||||
if (length > 0)
|
||||
{
|
||||
start = end;
|
||||
while (start < imgw && equal(pixels[start], spacer))
|
||||
++start;
|
||||
|
||||
spacing[glyphs[length - 1]] = (start > end) ? (start - end) : 0;
|
||||
}
|
||||
|
||||
// Replace spacer color with an empty pixel
|
||||
for (unsigned int i = 0; i < imgs; ++i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user