diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-05-31 15:50:55 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-05-31 15:50:55 -0700 |
| commit | 5d0791cafbebf6df7692836b60e86bc1238b4d57 (patch) | |
| tree | 51637fc27250d3a22389d22386e3a7a60bc4e1b5 | |
| parent | 7a117f52ed81999261fae3d43dfeb572c5e9887e (diff) | |
Fix off-by-one error
It caused the bottom and right edges to be one pixel short.
| -rw-r--r-- | shared-module/displayio/TileGrid.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index 02690b8e6..078ddf6b1 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -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; |
