@@ -3,13 +3,13 @@ class Spinner {
33 console . log ( error , errorInfo ) ;
44 }
55
6- reset ( prevProps , parentStyle , ape ) {
7- const { ctx } = ape ;
8- // parentStyle.backgroundColor // white
9- if ( ctx ) {
10- ctx . clearRect ( 0 , 0 , 18 , 18 ) ;
11- }
12- }
6+ // You can also use your own clear function although isn't recommended
7+ // unsafeClear(prevProps, parentStyle, ape) {
8+ // const {ctx} = ape;
9+ // const parentBackgroundColor = parentStyle.style.backgroundColor;
10+ // const newProps = {...prevProps, style: { color: parentBackgroundColor } } ;
11+ // this.render(newProps, ape);
12+ // }
1313
1414 render ( props , ape ) {
1515 const { ctx} = ape ;
@@ -18,24 +18,13 @@ class Spinner {
1818
1919 const offset = 8 ;
2020 ctx . save ( ) ;
21- // ctx.translate(offset, offset);
2221 ctx . translate ( style . left , style . top ) ;
2322 ctx . rotate ( degrees ) ;
24-
25- // Draw half open circle
2623 ctx . beginPath ( ) ;
27- ctx . lineWidth = 3 ;
24+ ctx . lineWidth = 50 ;
2825 ctx . arc ( 8 - offset , 8 - offset , 6 , 0 , 1.75 * Math . PI ) ;
2926 ctx . strokeStyle = color ;
3027 ctx . stroke ( ) ;
31-
32- // Draw arrowhead
33- ctx . lineWidth = 3 ;
34- ctx . moveTo ( 13 - offset , 1 - offset ) ;
35- ctx . lineTo ( 9 - offset , 5 - offset ) ;
36- ctx . lineTo ( 13 - offset , 5 - offset ) ;
37- ctx . lineTo ( 13 - offset , 1 - offset ) ;
38- ctx . stroke ( ) ;
3928 ctx . restore ( ) ;
4029 }
4130}
0 commit comments