summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2021-03-25 10:56:47 -0700
committerGitHub <noreply@github.com>2021-03-25 10:56:47 -0700
commit0105b30a07790ee1716ab3b14fab416c7d16a14c (patch)
tree7823793418ffaf1cf4a6d2eba79bbcd6be1126d8
parente9ceb9263e4939920678921c95d595cf5444d29a (diff)
parent3785eb7779f24c8195b137e7221fddc921554068 (diff)
Merge pull request #4484 from kmatch98/vector_fix
Corrects vectorio.Rectangle size dimensions
-rw-r--r--shared-module/vectorio/Rectangle.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/shared-module/vectorio/Rectangle.c b/shared-module/vectorio/Rectangle.c
index 5d48cc648..56be5ebb5 100644
--- a/shared-module/vectorio/Rectangle.c
+++ b/shared-module/vectorio/Rectangle.c
@@ -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;
@@ -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;
}