From 29fd483976cd2f47c5f34111176b1bd4a236882b Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Sat, 31 Oct 2026 17:29:47 -0700 Subject: [PATCH 1/2] bitmaptools: include the last row and column in draw_polygon's dirty area The dirty area's x2 and y2 are exclusive, but draw_polygon passed the largest x and y it drew. Pixels on the right and bottom edges stayed off the display, and purely horizontal or vertical lines did not appear. Fixes #9239. Co-Authored-By: Claude Opus 5.5 --- shared-module/bitmaptools/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/bitmaptools/__init__.c b/shared-module/bitmaptools/__init__.c index 295b0429b41..0a290c7ab16 100644 --- a/shared-module/bitmaptools/__init__.c +++ b/shared-module/bitmaptools/__init__.c @@ -537,7 +537,7 @@ void common_hal_bitmaptools_draw_polygon(displayio_bitmap_t *destination, void * draw_line(destination, xprev, yprev, x0, y0, value); } - displayio_area_t area = { xmin, ymin, xmax, ymax, NULL }; + displayio_area_t area = { xmin, ymin, xmax + 1, ymax + 1, NULL }; displayio_area_t bitmap_area = { 0, 0, destination->width, destination->height, NULL }; displayio_area_compute_overlap(&area, &bitmap_area, &area); displayio_bitmap_set_dirty_area(destination, &area); From fe129448754d12ed9ef06aefeffce0a254748982 Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Sat, 31 Oct 2026 17:58:30 -0700 Subject: [PATCH 2/2] bitmaptools: include the last row and column in draw_circle's dirty area The same exclusive-limit mistake as draw_polygon: pixels on the right and bottom edges stayed off the display, and a circle of radius 0 did not appear. Co-Authored-By: Claude Opus 5.5 --- shared-module/bitmaptools/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/bitmaptools/__init__.c b/shared-module/bitmaptools/__init__.c index 0a290c7ab16..13565639674 100644 --- a/shared-module/bitmaptools/__init__.c +++ b/shared-module/bitmaptools/__init__.c @@ -1069,9 +1069,9 @@ void common_hal_bitmaptools_draw_circle(displayio_bitmap_t *destination, int16_t xbb0, xbb1, ybb0, ybb1; xbb0 = x - radius; - xbb1 = x + radius; + xbb1 = x + radius + 1; ybb0 = y - radius; - ybb1 = y + radius; + ybb1 = y + radius + 1; displayio_area_t area = { xbb0, ybb0, xbb1, ybb1, NULL }; displayio_area_t bitmap_area = { 0, 0, destination->width, destination->height, NULL };