Skip to content

Commit 0105b30

Browse files
authored
Merge pull request #4484 from kmatch98/vector_fix
Corrects vectorio.Rectangle size dimensions
2 parents e9ceb92 + 3785eb7 commit 0105b30

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 = -1;
25-
out_area->y1 = -1;
24+
out_area->x1 = 0;
25+
out_area->y1 = 0;
2626
out_area->x2 = self->width;
2727
out_area->y2 = self->height;
2828
}

0 commit comments

Comments
 (0)