InDrawingMode Mouse Events

This adds event triggers for the InDrawingMode set of mouse event handlers.

I needed to add a mousemove event handler that fired without turning off
free draw, and imagined that others could use this functionality as
well.

Event strings are formatted using the typical non-namespaced DOM format, i.e. without
colons.
This commit is contained in:
Brian Whitton 2014-11-13 23:22:44 -05:00
parent 1d8d998ed5
commit 31a2a9c8bf

View file

@ -349,6 +349,11 @@
pointer = fabric.util.transformPoint(this.getPointer(e, true), ivt);
this.freeDrawingBrush.onMouseDown(pointer);
this.fire('mouse:down', { e: e });
var target = this.findTarget(e);
if (typeof target !== 'undefined') {
target.fire('mousedown', { e: e, target: target });
}
},
/**
@ -363,6 +368,11 @@
}
this.setCursor(this.freeDrawingCursor);
this.fire('mouse:move', { e: e });
var target = this.findTarget(e);
if (typeof target !== 'undefined') {
target.fire('mousemove', { e: e, target: target });
}
},
/**
@ -376,6 +386,11 @@
}
this.freeDrawingBrush.onMouseUp();
this.fire('mouse:up', { e: e });
var target = this.findTarget(e);
if (typeof target !== 'undefined') {
target.fire('mouseup', { e: e, target: target });
}
},
/**