@@ -804,34 +804,32 @@ impl OverlayContextInternal {
804804
805805 let transform = self . get_transform ( ) ;
806806
807- // Draw the background circle with a white fill and colored outline
808807 let circle = kurbo:: Circle :: new ( ( x, y) , DOWEL_PIN_RADIUS ) ;
809808 self . scene . fill ( peniko:: Fill :: NonZero , transform, Self :: parse_color ( COLOR_OVERLAY_WHITE ) , None , & circle) ;
810809 self . scene . stroke ( & kurbo:: Stroke :: new ( 1. ) , transform, Self :: parse_color ( color) , None , & circle) ;
811810
812- // Draw the two filled sectors using paths
813811 let mut path = BezPath :: new ( ) ;
814812
815- // Top-left sector
813+ let start1 = FRAC_PI_2 + angle;
814+ let start1_x = x + DOWEL_PIN_RADIUS * start1. cos ( ) ;
815+ let start1_y = y + DOWEL_PIN_RADIUS * start1. sin ( ) ;
816816 path. move_to ( kurbo:: Point :: new ( x, y) ) ;
817- let end_x = x + DOWEL_PIN_RADIUS * ( FRAC_PI_2 + angle. cos ( ) ) ;
818- let end_y = y + DOWEL_PIN_RADIUS * ( FRAC_PI_2 + angle. sin ( ) ) ;
819- path. line_to ( kurbo:: Point :: new ( end_x, end_y) ) ;
820- // Draw arc manually
821- let arc = kurbo:: Arc :: new ( ( x, y) , ( DOWEL_PIN_RADIUS , DOWEL_PIN_RADIUS ) , FRAC_PI_2 + angle, FRAC_PI_2 , 0.0 ) ;
822- arc. to_cubic_beziers ( 0.1 , |p1, p2, p| {
817+ path. line_to ( kurbo:: Point :: new ( start1_x, start1_y) ) ;
818+
819+ let arc1 = kurbo:: Arc :: new ( ( x, y) , ( DOWEL_PIN_RADIUS , DOWEL_PIN_RADIUS ) , start1, FRAC_PI_2 , 0.0 ) ;
820+ arc1. to_cubic_beziers ( 0.1 , |p1, p2, p| {
823821 path. curve_to ( p1, p2, p) ;
824822 } ) ;
825823 path. close_path ( ) ;
826824
827- // Bottom-right sector
825+ let start2 = PI + FRAC_PI_2 + angle;
826+ let start2_x = x + DOWEL_PIN_RADIUS * start2. cos ( ) ;
827+ let start2_y = y + DOWEL_PIN_RADIUS * start2. sin ( ) ;
828828 path. move_to ( kurbo:: Point :: new ( x, y) ) ;
829- let end_x = x + DOWEL_PIN_RADIUS * ( PI + FRAC_PI_2 + angle. cos ( ) ) ;
830- let end_y = y + DOWEL_PIN_RADIUS * ( PI + FRAC_PI_2 + angle. sin ( ) ) ;
831- path. line_to ( kurbo:: Point :: new ( end_x, end_y) ) ;
832- // Draw arc manually
833- let arc = kurbo:: Arc :: new ( ( x, y) , ( DOWEL_PIN_RADIUS , DOWEL_PIN_RADIUS ) , PI + FRAC_PI_2 + angle, FRAC_PI_2 , 0.0 ) ;
834- arc. to_cubic_beziers ( 0.1 , |p1, p2, p| {
829+ path. line_to ( kurbo:: Point :: new ( start2_x, start2_y) ) ;
830+
831+ let arc2 = kurbo:: Arc :: new ( ( x, y) , ( DOWEL_PIN_RADIUS , DOWEL_PIN_RADIUS ) , start2, FRAC_PI_2 , 0.0 ) ;
832+ arc2. to_cubic_beziers ( 0.1 , |p1, p2, p| {
835833 path. curve_to ( p1, p2, p) ;
836834 } ) ;
837835 path. close_path ( ) ;
0 commit comments