Fix a bug in the font editor where the last row of a symbol is cleared

when shifting the whole symbol up.
This commit is contained in:
Saveliy Skresanov 2023-10-06 23:10:47 +07:00 committed by jacob1
parent 48a3bf45fc
commit 0165a9b121
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995

View File

@ -529,7 +529,7 @@ void FontEditor::Translate(std::array<std::array<char, MAX_WIDTH>, FONT_H> &pixe
std::array<std::array<char, MAX_WIDTH>, FONT_H> old = pixels;
for(int j = 0; j < FONT_H; j++)
for(int i = 0; i < MAX_WIDTH; i++)
if(i - dx >= 0 && i - dx + 1 < MAX_WIDTH && j - dy >= 0 && j - dy + 1 < FONT_H)
if(i - dx >= 0 && i - dx < MAX_WIDTH && j - dy >= 0 && j - dy < FONT_H)
pixels[j][i] = old[j - dy][i - dx];
else
pixels[j][i] = 0;