Skip to content

Commit 5d0791c

Browse files
committed
Fix off-by-one error
It caused the bottom and right edges to be one pixel short.
1 parent 7a117f5 commit 5d0791c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

shared-module/displayio/TileGrid.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ void common_hal_displayio_tilegrid_construct(displayio_tilegrid_t *self, mp_obj_
5858
self->height_in_tiles = height;
5959
self->area.x1 = x;
6060
self->area.y1 = y;
61-
// -1 because areas are inclusive
62-
self->area.x2 = x + width * tile_width - 1;
63-
self->area.y2 = y + height * tile_height - 1;
61+
self->area.x2 = x + width * tile_width;
62+
self->area.y2 = y + height * tile_height;
6463
self->tile_width = tile_width;
6564
self->tile_height = tile_height;
6665
self->bitmap = bitmap;

0 commit comments

Comments
 (0)