Skip to content

Commit 7490adf

Browse files
committed
Use width for x. Thanks @deshipu
1 parent da3d75f commit 7490adf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

shared-module/displayio/TileGrid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ void common_hal_displayio_tilegrid_set_tile(displayio_tilegrid_t *self, uint16_t
221221
}
222222
int16_t tx = (x - self->top_left_x) % self->width_in_tiles;
223223
if (tx < 0) {
224-
tx += self->height_in_tiles;
224+
tx += self->width_in_tiles;
225225
}
226226
tile_area->x1 = tx * self->tile_width;
227227
tile_area->x2 = tile_area->x1 + self->tile_width;

0 commit comments

Comments
 (0)