mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-26 08:24:42 +00:00
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:
parent
1d8d998ed5
commit
31a2a9c8bf
1 changed files with 15 additions and 0 deletions
|
|
@ -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 });
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue