Skip to content

Commit

Permalink
Merge branch 'tuupola:master' into chips44-update-2
Browse files Browse the repository at this point in the history
  • Loading branch information
CHiPs44 authored Mar 16, 2023
2 parents 76d3456 + 302b012 commit 02655e3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/hagl_circle.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ hagl_draw_circle(void const *surface, int16_t xc, int16_t yc, int16_t r, hagl_co
hagl_put_pixel(surface, xc - y, yc - x, color);

while (y >= x) {
x++;

if (d > 0) {
y--;
d = d + 4 * (x - y) + 10;
y--;
x++;
} else {
d = d + 4 * x + 6;
x++;
}

hagl_put_pixel(surface, xc + x, yc + y, color);
Expand All @@ -87,13 +87,14 @@ hagl_fill_circle(void const *surface, int16_t x0, int16_t y0, int16_t r, hagl_co
hagl_draw_hline(surface, x0 - x, y0 - y, x * 2, color);
hagl_draw_hline(surface, x0 - y, y0 + x, y * 2, color);
hagl_draw_hline(surface, x0 - y, y0 - x, y * 2, color);
x++;

if (d > 0) {
y--;
d = d + 4 * (x - y) + 10;
} else {
if (d <= 0) {
d = d + 4 * x + 6;
x++;
} else {
d = d + 4 * (x - y) + 10;
x++;
y--;
}
}
}

0 comments on commit 02655e3

Please sign in to comment.