Skip to content

Commit 32f85f7

Browse files
committed
vectorio: fix up Rectangle
* Fix drawing 1 pixel too large * Need to pad dirty area to ensure removed shapes are fully removed
1 parent 58c8e00 commit 32f85f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shared-module/vectorio/Rectangle.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void common_hal_vectorio_rectangle_construct(vectorio_rectangle_t *self, uint32_
1212

1313
uint32_t common_hal_vectorio_rectangle_get_pixel(void *obj, int16_t x, int16_t y) {
1414
vectorio_rectangle_t *self = obj;
15-
if (x < 0 || x >= self->width || y >= self->height || y < 0) {
15+
if (x < 0 || x > self->width || y > self->height || y < 0) {
1616
return 0;
1717
}
1818
return 1;
@@ -21,8 +21,8 @@ uint32_t common_hal_vectorio_rectangle_get_pixel(void *obj, int16_t x, int16_t y
2121

2222
void common_hal_vectorio_rectangle_get_area(void *rectangle, displayio_area_t *out_area) {
2323
vectorio_rectangle_t *self = rectangle;
24-
out_area->x1 = 0;
25-
out_area->y1 = 0;
24+
out_area->x1 = -1;
25+
out_area->y1 = -1;
2626
out_area->x2 = self->width;
2727
out_area->y2 = self->height;
2828
}

0 commit comments

Comments
 (0)