mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Fix porting mistakes.
This commit is contained in:
parent
327515a9de
commit
0e37f86156
1 changed files with 6 additions and 7 deletions
|
@ -129,19 +129,18 @@ var ToolHandler = this.ToolHandler = Base.extend({
|
||||||
// not check the first call for a change of position.
|
// not check the first call for a change of position.
|
||||||
// Subsequent calls required by min/maxDistance functionality
|
// Subsequent calls required by min/maxDistance functionality
|
||||||
// will require it, otherwise this might loop endlessly.
|
// will require it, otherwise this might loop endlessly.
|
||||||
this.needsChange = false;
|
var needsChange = false,
|
||||||
// If the mouse is moving faster than maxDistance, do not
|
// If the mouse is moving faster than maxDistance, do not
|
||||||
// produce events for what is left after the first event is
|
// produce events for what is left after the first event is
|
||||||
// generated in case it is shorter than maxDistance, as this
|
// generated in case it is shorter than maxDistance, as this
|
||||||
// would produce weird results. matchMaxDistance controls this.
|
// would produce weird results. matchMaxDistance controls this.
|
||||||
this.matchMaxDistance = false;
|
matchMaxDistance = false;
|
||||||
while (this.updateEvent(type, pt, this.minDistance,
|
while (this.updateEvent(type, pt, this.minDistance,
|
||||||
this.maxDistance, false, this.needsChange,
|
this.maxDistance, false, needsChange, matchMaxDistance)) {
|
||||||
this.matchMaxDistance)) {
|
|
||||||
if (this.onMouseDrag)
|
if (this.onMouseDrag)
|
||||||
this.onMouseDrag(new ToolEvent(this, type, event));
|
this.onMouseDrag(new ToolEvent(this, type, event));
|
||||||
this.needsChange = true;
|
needsChange = true;
|
||||||
this.matchMaxDistance = true;
|
matchMaxDistance = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'mouse-up':
|
case 'mouse-up':
|
||||||
|
@ -157,7 +156,7 @@ var ToolHandler = this.ToolHandler = Base.extend({
|
||||||
false, false);
|
false, false);
|
||||||
if (this.onMouseUp)
|
if (this.onMouseUp)
|
||||||
this.onMouseUp(new ToolEvent(this, type, event));
|
this.onMouseUp(new ToolEvent(this, type, event));
|
||||||
// Start with new values for TRACK_CURSOR
|
// Start with new values for 'mouse-move'
|
||||||
this.updateEvent(type, pt, null, null, true, false, false);
|
this.updateEvent(type, pt, null, null, true, false, false);
|
||||||
this.firstMove = true;
|
this.firstMove = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue