|
@@ -2718,23 +2718,24 @@ void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color)
|
|
// Draw circle within an image
|
|
// Draw circle within an image
|
|
void ImageDrawCircle(Image* dst, int centerX, int centerY, int radius, Color color)
|
|
void ImageDrawCircle(Image* dst, int centerX, int centerY, int radius, Color color)
|
|
{
|
|
{
|
|
- int x = 0, y = radius;
|
|
|
|
- int decesionParameter = 3 - 2 * radius;
|
|
|
|
|
|
+ int x = 0;
|
|
|
|
+ int y = radius;
|
|
|
|
+ int decesionParameter = 3 - 2*radius;
|
|
|
|
|
|
while (y >= x)
|
|
while (y >= x)
|
|
{
|
|
{
|
|
- ImageDrawRectangle(dst, centerX - x, centerY + y, x * 2, 1, color);
|
|
|
|
- ImageDrawRectangle(dst, centerX - x, centerY - y, x * 2, 1, color);
|
|
|
|
- ImageDrawRectangle(dst, centerX - y, centerY + x, y * 2, 1, color);
|
|
|
|
- ImageDrawRectangle(dst, centerX - y, centerY - x, y * 2, 1, color);
|
|
|
|
|
|
+ ImageDrawRectangle(dst, centerX - x, centerY + y, x*2, 1, color);
|
|
|
|
+ ImageDrawRectangle(dst, centerX - x, centerY - y, x*2, 1, color);
|
|
|
|
+ ImageDrawRectangle(dst, centerX - y, centerY + x, y*2, 1, color);
|
|
|
|
+ ImageDrawRectangle(dst, centerX - y, centerY - x, y*2, 1, color);
|
|
x++;
|
|
x++;
|
|
|
|
|
|
- if (decesionParameter > 0) {
|
|
|
|
|
|
+ if (decesionParameter > 0)
|
|
|
|
+ {
|
|
y--;
|
|
y--;
|
|
- decesionParameter = decesionParameter + 4 * (x - y) + 10;
|
|
|
|
- } else {
|
|
|
|
- decesionParameter = decesionParameter + 4 * x + 6;
|
|
|
|
- }
|
|
|
|
|
|
+ decesionParameter = decesionParameter + 4*(x - y) + 10;
|
|
|
|
+ }
|
|
|
|
+ else decesionParameter = decesionParameter + 4*x + 6;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2747,7 +2748,8 @@ void ImageDrawCircleV(Image* dst, Vector2 center, int radius, Color color)
|
|
// Draw circle outline within an image
|
|
// Draw circle outline within an image
|
|
void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color)
|
|
void ImageDrawCircleLines(Image *dst, int centerX, int centerY, int radius, Color color)
|
|
{
|
|
{
|
|
- int x = 0, y = radius;
|
|
|
|
|
|
+ int x = 0;
|
|
|
|
+ int y = radius;
|
|
int decesionParameter = 3 - 2*radius;
|
|
int decesionParameter = 3 - 2*radius;
|
|
|
|
|
|
while (y >= x)
|
|
while (y >= x)
|