Fix off-by-one error

It caused the bottom and right edges to be one pixel short.
This commit is contained in:
Scott Shawcroft 2019-05-31 15:50:55 -07:00
parent 7a117f52ed
commit 5d0791cafb
No known key found for this signature in database
GPG Key ID: FD0EDC4B6C53CA59
1 changed files with 2 additions and 3 deletions

View File

@ -58,9 +58,8 @@ void common_hal_displayio_tilegrid_construct(displayio_tilegrid_t *self, mp_obj_
self->height_in_tiles = height;
self->area.x1 = x;
self->area.y1 = y;
// -1 because areas are inclusive
self->area.x2 = x + width * tile_width - 1;
self->area.y2 = y + height * tile_height - 1;
self->area.x2 = x + width * tile_width;
self->area.y2 = y + height * tile_height;
self->tile_width = tile_width;
self->tile_height = tile_height;
self->bitmap = bitmap;