Centre images when printing

This commit is contained in:
fruchti 2018-08-23 13:41:07 +02:00
parent 0774ed43f5
commit 79ccdda9e3
2 changed files with 5 additions and 3 deletions

View file

@ -1 +1 @@
472 473

View file

@ -60,8 +60,10 @@ void Print_Image(const uint8_t *data, int width, int height, int scale)
& (0x80 >> ((j / scale) % 8)); & (0x80 >> ((j / scale) % 8));
if(black) if(black)
{ {
Print_Buffer[i * LTP1245_LINE_BYTES + j / 8] |= int x = j;
(0x80 >> (j % 8)); x += (LTP1245_LINEWIDTH - width * scale) / 2;
Print_Buffer[i * LTP1245_LINE_BYTES + x / 8] |=
(0x80 >> (x % 8));
} }
} }
currentline++; currentline++;