You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(this._currentSnapshotIndex<this._snapshots.length-1&&this._maxSnapshots>0)this._snapshots.splice(this._currentSnapshotIndex+1);// Delete all redo snapshots
107
+
constcoords=this._getMouseCoords(e);
107
108
108
109
this._startStroke(
109
-
this._getMouseCoords(e),
110
+
coords,
110
111
'mouse'
111
112
)
113
+
this._lastCoords.set('mouse',coords);
112
114
}
113
115
}
114
116
@@ -118,7 +120,10 @@ export class RealDrawBoard extends RealRenderer {
@@ -140,6 +145,7 @@ export class RealDrawBoard extends RealRenderer {
140
145
if(this._lastCoords.has('mouse')){
141
146
this._removeDOMEvents();
142
147
this._endStroke(this._getMouseCoords(e),'mouse');
148
+
this._lastCoords.delete('mouse');
143
149
this._display(this.graphPixels);
144
150
145
151
setTimeout(()=>{// Delay to let the canvas 'settle'
@@ -157,6 +163,7 @@ export class RealDrawBoard extends RealRenderer {
157
163
_mouseMoveEventListener=(e: MouseEvent)=>{
158
164
constcoords=this._getMouseCoords(e);
159
165
this._doStroke(coords,'mouse');
166
+
this._lastCoords.set('mouse',coords);
160
167
}
161
168
162
169
_previewMouseMoveEventListener=(e: MouseEvent)=>{
@@ -176,17 +183,26 @@ export class RealDrawBoard extends RealRenderer {
176
183
for(leti=0;i<e.touches.length;i++){
177
184
if(this._currentSnapshotIndex<this._snapshots.length-1&&this._maxSnapshots>0)this._snapshots.splice(this._currentSnapshotIndex+1);// Delete all redo snapshots
0 commit comments