Fix screen stack popping and add a menu

This commit is contained in:
2019-06-26 09:07:34 -07:00
parent 5cfa22c650
commit e0b49ba109
9 changed files with 269 additions and 38 deletions

View File

@@ -206,7 +206,7 @@ void DisplayDriver::write_glyph_unaligned(uint32_t x_off, uint32_t y_off, const
byte_cols++;
}
for (size_t x = 0; x < g->cols; x++) {
for (size_t x = 0; x < g->cols && x < DISPLAY_WIDTH; x++) {
for (size_t y = 0; y < g->rows && y < DISPLAY_HEIGHT; y++) {
int byte_x = x / 8;
int byte_y = y;
@@ -268,7 +268,7 @@ void DisplayDriver::char_at(uint32_t *x_off, uint32_t y_off, char c, const struc
return;
}
if (*x_off + g->left + g->cols > DISPLAY_WIDTH) {
if (*x_off + g->left + g->cols >= DISPLAY_WIDTH) {
return;
}
@@ -301,15 +301,6 @@ void DisplayDriver::string_at(uint32_t *x_off, uint32_t y_off, const char *strin
}
}
// TODO: Implement this
// void DisplayDriver::rect_at(int x_off, int y_off,
// int width, int height,
// bool is_black,
// int line_width)
// {
// }
void DisplayDriver::refresh()
{
if (!m_is_dirty) {