Skip to content

Corrects vectorio.Rectangle size dimensions #4484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions shared-module/vectorio/Rectangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void common_hal_vectorio_rectangle_construct(vectorio_rectangle_t *self, uint32_

uint32_t common_hal_vectorio_rectangle_get_pixel(void *obj, int16_t x, int16_t y) {
vectorio_rectangle_t *self = obj;
if (x < 0 || x > self->width || y > self->height || y < 0) {
if (x < 0 || x >= self->width || y >= self->height || y < 0) {
return 0;
}
return 1;
Expand All @@ -21,8 +21,8 @@ uint32_t common_hal_vectorio_rectangle_get_pixel(void *obj, int16_t x, int16_t y

void common_hal_vectorio_rectangle_get_area(void *rectangle, displayio_area_t *out_area) {
vectorio_rectangle_t *self = rectangle;
out_area->x1 = -1;
out_area->y1 = -1;
out_area->x1 = 0;
out_area->y1 = 0;
out_area->x2 = self->width;
out_area->y2 = self->height;
}
Expand Down