in share/src/sprite-editor/canvasGrid.ts [554:585]
handle(event: InputEvent, col: number, row: number) {
switch (event) {
case InputEvent.Up:
this.update(col, row);
this.isDown = false;
this.fire(GestureType.Up);
break;
case InputEvent.Down:
if (!this.isDown) {
this.update(col, row);
this.isDown = true;
this.fire(GestureType.Down);
}
break;
case InputEvent.Move:
if (col === this.lastCol && row === this.lastRow) return;
this.update(col, row);
if (this.isDown) {
this.fire(GestureType.Drag);
}
else {
this.fire(GestureType.Move);
}
break;
case InputEvent.Leave:
this.update(col, row);
this.isDown = false;
this.fire(GestureType.Leave);
break;
}
}