File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -73,22 +73,20 @@ class Store {
73
73
}
74
74
endPath ( event , position ) {
75
75
if ( this . data . mouseTracker ) {
76
+ this . data . mouseTracker . path . push ( position ) ;
76
77
if ( this . toolType === POINTER ) {
77
- this . processPointEvent ( this . data . mouseTracker )
78
+ this . addVersion ( )
78
79
} else if ( this . data . mouseTracker . class ) {
79
- this . data . mouseTracker . path . push ( position ) ;
80
80
this . addShapeToCanvas ( this . data . mouseTracker )
81
81
}
82
82
this . data . mouseTracker = null ;
83
83
this . emitChanges ( )
84
84
}
85
85
}
86
86
addShapeToCanvas ( shape ) {
87
- this . data . shapes = this . data . shapes . push ( shape ) ;
88
- this . data . mouseTracker = null ;
89
- this . _catHistory ( ) ;
90
- this . history . push ( this . data . shapes ) ;
91
- this . historyIndex = - 1 ;
87
+ this . data . shapes = this . data . shapes . push ( shape )
88
+ this . data . mouseTracker = null
89
+ this . addVersion ( )
92
90
}
93
91
selectShape ( position ) {
94
92
this . data . shapes = this . data . shapes . map ( shape => {
@@ -99,8 +97,10 @@ class Store {
99
97
}
100
98
} )
101
99
}
102
- processPointEvent ( mouseTracker ) {
103
-
100
+ addVersion ( ) {
101
+ this . _catHistory ( ) ;
102
+ this . history . push ( this . data . shapes ) ;
103
+ this . historyIndex = - 1 ;
104
104
}
105
105
106
106
undo ( ) {
You can’t perform that action at this time.
0 commit comments