1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 17:55:19 +03:00

[Horus] The SETPOS char (0x1F) is again implemented on Horus (it's needed in the VERSION menu)

This commit is contained in:
Bertrand Songis 2016-04-09 11:23:44 +02:00
parent c5a44250fc
commit ee9bb73ef9

View file

@ -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;
while (len--) {
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);
else
c = pgm_read_byte(s);
if (!c) {
if (setpos) {
pos = c;
setpos = false;
}
else if (!c) {
break;
}
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);
INCREMENT_POS(width);
}
else if (c == 0x1F) { // X-coord prefix
setpos = true;
}
else if (c == 0x1E) {
pos = orig_pos;
if (flags & VERTICAL)