@@ -2531,53 +2531,53 @@ draw_circle_xaolinwu(SDL_Surface *surf, int x0, int y0, int radius,
25312531 float prev_opacity = 0 ;
25322532 if (radius_ == radius - thickness ) {
25332533 while (x < y ) {
2534- x ++ ;
2535- float height = sqrt (pow (radius_ , 2 ) - pow (x - 1 , 2 ));
2534+ float height = sqrt (pow (radius_ , 2 ) - pow (x , 2 ));
25362535 float opacity = 255 * (ceil (height ) - height );
25372536 if (opacity < prev_opacity ) {
2538- y -- ;
2537+ -- y ;
25392538 }
25402539 prev_opacity = opacity ;
2541- draw_eight_symetric_pixels (surf , x0 , y0 , color , x - 1 , y , 255 ,
2540+ draw_eight_symetric_pixels (surf , x0 , y0 , color , x , y , 255 ,
25422541 top_right , top_left , bottom_left ,
25432542 bottom_right , drawn_area );
25442543 draw_eight_symetric_pixels (
2545- surf , x0 , y0 , color , x - 1 , y - 1 , opacity , top_right ,
2544+ surf , x0 , y0 , color , x , y - 1 , opacity , top_right ,
25462545 top_left , bottom_left , bottom_right , drawn_area );
2546+ ++ x ;
25472547 }
25482548 }
25492549 else if (radius_ == radius ) {
25502550 while (x < y ) {
2551- x ++ ;
2552- float height = sqrt (pow (radius_ , 2 ) - pow (x - 1 , 2 ));
2551+ float height = sqrt (pow (radius_ , 2 ) - pow (x , 2 ));
25532552 float opacity = 255 * (ceil (height ) - height );
25542553 if (opacity < prev_opacity ) {
2555- y -- ;
2554+ -- y ;
25562555 }
25572556 prev_opacity = opacity ;
25582557 draw_eight_symetric_pixels (
2559- surf , x0 , y0 , color , x - 1 , y , 255 - opacity , top_right ,
2560- top_left , bottom_left , bottom_right , drawn_area );
2561- draw_eight_symetric_pixels (
2562- surf , x0 , y0 , color , x - 1 , y - 1 , 255 , top_right ,
2558+ surf , x0 , y0 , color , x , y , 255 - opacity , top_right ,
25632559 top_left , bottom_left , bottom_right , drawn_area );
2560+ draw_eight_symetric_pixels (surf , x0 , y0 , color , x , y - 1 , 255 ,
2561+ top_right , top_left , bottom_left ,
2562+ bottom_right , drawn_area );
2563+ ++ x ;
25642564 }
25652565 }
25662566 else {
25672567 while (x < y ) {
2568- x ++ ;
2569- float height = sqrt (pow (radius_ , 2 ) - pow (x - 1 , 2 ));
2568+ float height = sqrt (pow (radius_ , 2 ) - pow (x , 2 ));
25702569 float opacity = 255 * (ceil (height ) - height );
25712570 if (opacity < prev_opacity ) {
2572- y -- ;
2571+ -- y ;
25732572 }
25742573 prev_opacity = opacity ;
2575- draw_eight_symetric_pixels (surf , x0 , y0 , color , x - 1 , y , 255 ,
2574+ draw_eight_symetric_pixels (surf , x0 , y0 , color , x , y , 255 ,
25762575 top_right , top_left , bottom_left ,
25772576 bottom_right , drawn_area );
2578- draw_eight_symetric_pixels (
2579- surf , x0 , y0 , color , x - 1 , y - 1 , 255 , top_right ,
2580- top_left , bottom_left , bottom_right , drawn_area );
2577+ draw_eight_symetric_pixels (surf , x0 , y0 , color , x , y - 1 , 255 ,
2578+ top_right , top_left , bottom_left ,
2579+ bottom_right , drawn_area );
2580+ ++ x ;
25812581 }
25822582 }
25832583 }
@@ -2592,19 +2592,19 @@ draw_circle_xaolinwu_thin(SDL_Surface *surf, int x0, int y0, int radius,
25922592 int y = radius ;
25932593 float prev_opacity = 0 ;
25942594 while (x < y ) {
2595- x ++ ;
2596- float height = sqrt (pow (radius , 2 ) - pow (x - 1 , 2 ));
2595+ float height = sqrt (pow (radius , 2 ) - pow (x , 2 ));
25972596 float opacity = 255 * (ceil (height ) - height );
25982597 if (opacity < prev_opacity ) {
2599- y -- ;
2598+ -- y ;
26002599 }
26012600 prev_opacity = opacity ;
2602- draw_eight_symetric_pixels (surf , x0 , y0 , color , x - 1 , y ,
2603- 255 - opacity , top_right , top_left ,
2604- bottom_left , bottom_right , drawn_area );
2605- draw_eight_symetric_pixels (surf , x0 , y0 , color , x - 1 , y - 1 , opacity ,
2601+ draw_eight_symetric_pixels (surf , x0 , y0 , color , x , y , 255 - opacity ,
2602+ top_right , top_left , bottom_left ,
2603+ bottom_right , drawn_area );
2604+ draw_eight_symetric_pixels (surf , x0 , y0 , color , x , y - 1 , opacity ,
26062605 top_right , top_left , bottom_left ,
26072606 bottom_right , drawn_area );
2607+ ++ x ;
26082608 }
26092609}
26102610
0 commit comments