mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
Make sure mousemove events have lastPoint set even for the first move so event.delta is always defined for them.
This commit is contained in:
parent
8b7eea4663
commit
016476d1dc
1 changed files with 3 additions and 1 deletions
|
@ -293,7 +293,9 @@ var Tool = this.Tool = Base.extend({
|
|||
if (needsChange && pt.equals(this._point))
|
||||
return false;
|
||||
}
|
||||
this._lastPoint = this._point;
|
||||
// Make sure mousemove events have lastPoint set even for the first move
|
||||
// so event.delta is always defined for them.
|
||||
this._lastPoint = first && type == 'mousemove' ? pt : this._point;
|
||||
this._point = pt;
|
||||
switch (type) {
|
||||
case 'mousedown':
|
||||
|
|
Loading…
Reference in a new issue