graphics_rgb565.c Fixed screen size check

This commit is contained in:
Federico Amedeo Izzo 2020-10-22 17:29:32 +02:00 committed by Niccolò Izzo
parent 3096146da8
commit b04617007d
1 changed files with 1 additions and 1 deletions

View File

@ -121,7 +121,7 @@ void gfx_fillScreen(color_t color)
void gfx_setPixel(point_t pos, color_t color) void gfx_setPixel(point_t pos, color_t color)
{ {
if (pos.x > screen_width || pos.y > screen_height) if (pos.x >= screen_width || pos.y >= screen_height)
return; // off the screen return; // off the screen
buf[pos.x + pos.y*screen_width] = _true2highColor(color); buf[pos.x + pos.y*screen_width] = _true2highColor(color);