File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ module.exports = async name => {
99 const svg = [ ] ;
1010 svg . push ( '<svg viewBox="-20 -20 40 40" xmlns="http://www.w3.org/2000/svg">' ) ;
1111 svg . push ( '<polygon points="' ) ;
12- svg . push ( points . map ( point => `${ point . x } ,${ point . y } ` ) . join ( ' ' ) ) ;
12+ svg . push ( points . map ( ( { x , y } ) => `${ x } ,${ y } ` ) . join ( ' ' ) ) ;
1313 svg . push ( '" /></svg>' ) ;
1414 return svg . join ( '' ) ;
1515} ;
Original file line number Diff line number Diff line change 1+ const resize = ( point , k ) => {
2+ let { x, y } = point ;
3+ x *= k ;
4+ y *= k ;
5+ point . x = x ;
6+ point . y = y ;
7+ } ;
8+
9+ module . exports = async ( name , k ) => {
10+ const shape = memory . get ( name ) ;
11+ if ( ! shape ) return 'Shape is not found' ;
12+ for ( const key in shape ) {
13+ const point = shape [ key ] ;
14+ resize ( point , k ) ;
15+ }
16+ return 'Shape rotated' ;
17+ } ;
You can’t perform that action at this time.
0 commit comments