File tree 1 file changed +12
-15
lines changed
1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -50,27 +50,24 @@ export class SvgAnimation extends Two {
50
50
} )
51
51
}
52
52
53
- // to fix original position
54
- const toBasePosition = ( ) =>
53
+ const sceneChildrenRestore = ( ) =>
55
54
this . scene . children . map ( ( child : Two . Object ) => {
56
- this . scene . children . map ( ( child : Two . Object ) => {
57
- const vertices = ( child as Two . Path ) . vertices
58
- if ( ! vertices ) return
59
- vertices . map ( ( v : Two . Anchor | any ) => {
60
- // TODO: define position types
61
- if ( ! v . position ) {
62
- return
63
- }
64
- v . x = v . position . x
65
- v . y = v . position . y
66
- delete v . position
67
- } )
55
+ const vertices = ( child as Two . Path ) . vertices
56
+ if ( ! vertices ) return
57
+ vertices . map ( ( v : Two . Anchor | any ) => {
58
+ // TODO: define position types
59
+ if ( ! v . position ) {
60
+ return
61
+ }
62
+ v . x = v . position . x
63
+ v . y = v . position . y
64
+ delete v . position
68
65
} )
69
66
} )
70
67
this . bind ( 'update' , updateShake ) . play ( )
71
68
return ( ) => {
72
69
this . unbind ( 'update' , updateShake )
73
- toBasePosition ( )
70
+ sceneChildrenRestore ( )
74
71
}
75
72
}
76
73
/**
You can’t perform that action at this time.
0 commit comments