summaryrefslogtreecommitdiff
path: root/shared-module
diff options
context:
space:
mode:
authorwarriorofwire <3454741+WarriorOfWire@users.noreply.github.com>2020-05-10 16:21:07 -0700
committerwarriorofwire <3454741+WarriorOfWire@users.noreply.github.com>2020-05-10 16:21:07 -0700
commit32f85f7a44b6ce753070168b4f008a9499d70883 (patch)
tree8f116ae580f00bc78e7959b7e21b0eb5e3ae677a /shared-module
parent58c8e00745064bd290fc9ec18a838960b27c1eea (diff)
vectorio: fix up Rectangle
* Fix drawing 1 pixel too large * Need to pad dirty area to ensure removed shapes are fully removed
Diffstat (limited to 'shared-module')
-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 dfad58a4d..7fabe6ff9 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 = 0;
- out_area->y1 = 0;
+ out_area->x1 = -1;
+ out_area->y1 = -1;
out_area->x2 = self->width;
out_area->y2 = self->height;
}