[Horus] The SETPOS char (0x1F) is again implemented on Horus (it's needed in the VERSION menu)
This commit is contained in:
@@ -348,6 +348,7 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool setpos = false;
|
||||||
const coord_t orig_pos = pos;
|
const coord_t orig_pos = pos;
|
||||||
while (len--) {
|
while (len--) {
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
@@ -355,7 +356,11 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l
|
|||||||
c = idx2char(*s);
|
c = idx2char(*s);
|
||||||
else
|
else
|
||||||
c = pgm_read_byte(s);
|
c = pgm_read_byte(s);
|
||||||
if (!c) {
|
if (setpos) {
|
||||||
|
pos = c;
|
||||||
|
setpos = false;
|
||||||
|
}
|
||||||
|
else if (!c) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (c >= 0x20) {
|
else if (c >= 0x20) {
|
||||||
@@ -375,6 +380,9 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l
|
|||||||
width = drawCharWithoutCache(x, y, font, fontspecs, getMappedChar(c), flags);
|
width = drawCharWithoutCache(x, y, font, fontspecs, getMappedChar(c), flags);
|
||||||
INCREMENT_POS(width);
|
INCREMENT_POS(width);
|
||||||
}
|
}
|
||||||
|
else if (c == 0x1F) { // X-coord prefix
|
||||||
|
setpos = true;
|
||||||
|
}
|
||||||
else if (c == 0x1E) {
|
else if (c == 0x1E) {
|
||||||
pos = orig_pos;
|
pos = orig_pos;
|
||||||
if (flags & VERTICAL)
|
if (flags & VERTICAL)
|
||||||
|
|||||||
Reference in New Issue
Block a user