@@ -799,28 +799,27 @@ draw_parametrized_curve_with_derivative_and_antialiasing(
799799
800800static void
801801draw_parametrized_curve_with_derivative (
802- Canvas * self , void * curve_data , double line_width , curve_func xfunc , curve_func yfunc , curve_func x_prime , curve_func y_prime ,
803- int x_offset , int yoffset , double thickness_fudge
802+ Canvas * self , void * curve_data , double line_width , curve_func xfunc , curve_func yfunc , curve_func x_prime , curve_func y_prime
804803) {
805804 if (line_width <= 2 * self -> supersample_factor ) {
806805 // The old algorithm looks better for very thin lines
807- draw_parametrized_thin_curve (self , line_width , xfunc (curve_data , t ), yfunc (curve_data , t ), x_offset , y_offset );
806+ draw_parametrized_thin_curve (self , line_width , xfunc (curve_data , t ), yfunc (curve_data , t ), 0 , 0 );
808807 return ;
809808 }
810809 double larger_dim = fmax (self -> height , self -> width );
811810 double step = 1.0 / larger_dim ;
812811 const double min_step = step / 100. , max_step = step ;
813812 line_width = fmax (1. , line_width );
814813 const double half_thickness = line_width / 2.0 ;
815- const double distance_limit = half_thickness + thickness_fudge ;
814+ const double distance_limit = half_thickness ;
816815 double t = 0 ;
817816 while (true) {
818817 double x = xfunc (curve_data , t ), y = yfunc (curve_data , t );
819818 for (double dy = - line_width ; dy <= line_width ; dy ++ ) {
820819 for (double dx = - line_width ; dx <= line_width ; dx ++ ) {
821820 double px = x + dx , py = y + dy ;
822821 double dist = distance (x , y , px , py );
823- int row = (int )py + yoffset , col = (int )px + x_offset ;
822+ int row = (int )py , col = (int )px ;
824823 if (dist > distance_limit || row >= (int )self -> height || row < 0 || col >= (int )self -> width || col < 0 ) continue ;
825824 const int offset = row * self -> width + col ;
826825 double alpha = 1.0 - (dist / half_thickness );
@@ -844,7 +843,7 @@ rounded_separator(Canvas *self, uint level, bool left) {
844843 int c1x = find_bezier_for_D (minus (self -> width , gap ), self -> height );
845844 CubicBezier cb = {.end = {.y = self -> height - 1 }, .c1 = {.x = c1x }, .c2 = {.x = c1x , .y = self -> height - 1 }};
846845 double line_width = thickness_as_float (self , level , true);
847- #define d draw_parametrized_curve_with_derivative(self, &cb, line_width, bezier_x, bezier_y, bezier_prime_x, bezier_prime_y, 0, 0, 0 )
846+ #define d draw_parametrized_curve_with_derivative(self, &cb, line_width, bezier_x, bezier_y, bezier_prime_x, bezier_prime_y)
848847 if (left ) { d ; } else { mirror_horizontally (d ); }
849848#undef d
850849}
@@ -887,7 +886,7 @@ spinner(Canvas *self, uint level, double start_degrees, double end_degrees) {
887886 double line_width = thickness_as_float (self , level , true);
888887 double radius = fmax (0 , fmin (x , y ) - line_width / 2.0 );
889888 Circle c = circle (x , y , radius , start_degrees , end_degrees );
890- draw_parametrized_curve_with_derivative (self , & c , line_width , circle_x , circle_y , circle_prime_x , circle_prime_y , 0 , 0 , 0 );
889+ draw_parametrized_curve_with_derivative (self , & c , line_width , circle_x , circle_y , circle_prime_x , circle_prime_y );
891890}
892891
893892static void
@@ -918,7 +917,7 @@ draw_fish_eye(Canvas *self, uint level UNUSED) {
918917 double line_width = fmax (1. * self -> supersample_factor , (radius - central_radius ) / 2.5 );
919918 radius = fmax (0 , fmin (x , y ) - line_width / 2. );
920919 Circle c = circle (x , y , radius , 0 , 360 );
921- draw_parametrized_curve_with_derivative (self , & c , line_width , circle_x , circle_y , circle_prime_x , circle_prime_y , 0 , 0 , 0 );
920+ draw_parametrized_curve_with_derivative (self , & c , line_width , circle_x , circle_y , circle_prime_x , circle_prime_y );
922921}
923922
924923static void
0 commit comments