Skip to content
Snippets Groups Projects
Commit 461d36a1 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Draw the ellipse pixel when the angle is equal to start/end as well

Being stritly less/greater causes a one pixel gap at the start/end
of the ellipse, meaning flood fills can escape.
parent 634c8763
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2139 passed
......@@ -9863,7 +9863,7 @@ full_ellipse(int xc, int yc, int sa, int ea, int a, int b, bool fill, uint32_t c
}
}
if (rip.borders) {
if (sa < qangle && ea > qangle)
if (sa <= qangle && ea >= qangle)
set_pixel(xc-x, yc-y, colour);
}
}
......@@ -9876,18 +9876,18 @@ full_ellipse(int xc, int yc, int sa, int ea, int a, int b, bool fill, uint32_t c
}
if (rip.borders) {
// Top-right quadrant.
if (sa < angle && ea > angle)
if (sa <= angle && ea >= angle)
set_pixel(xc+x, yc-y, colour);
// Bottom-left quadrant.
qangle = 180 + angle;
if (sa < qangle && ea > qangle)
if (sa <= qangle && ea >= qangle)
set_pixel(xc-x, yc+y, colour);
}
}
// Bottom-right quadrant
qangle = 360 - angle;
if (rip.borders) {
if (sa < qangle && ea > qangle)
if (sa <= qangle && ea >= qangle)
set_pixel(xc+x, yc+y, colour);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment