8000 fixing algorithm and MAX · megacoder/circuitpython@1931b6c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1931b6c

Browse files
committed
fixing algorithm and MAX
1 parent 4986ad6 commit 1931b6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-module/bitmaptools/__init__.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,15 +934,15 @@ STATIC void draw_circle(displayio_bitmap_t *destination,
934934
x = MIN(x, destination->width);
935935
x = MAX(0, x);
936936
y = MIN(y, destination->height);
937-
y = MIN(0, y);
937+
y = MAX(0, y);
938938

939939
BITMAP_DEBUG("x, y, radius (%4d, %4d, %4d)\n", x, y, radius);
940940

941941
yb = radius;
942942
d = 3 - 2 * radius;
943943

944944
// Bresenham's circle algorithm
945-
for (int xb = 0; x <= yb; xb++) {
945+
for (int xb = 0; xb <= yb; xb++) {
946946
displayio_bitmap_write_pixel(destination, xb + x, yb + y, value);
947947
displayio_bitmap_write_pixel(destination, -xb + x, -yb + y, value);
948948
displayio_bitmap_write_pixel(destination, -xb + x, yb + y, value);

0 commit comments

Comments
 (0)
0