Fire "mouse:down", "mouse:move", "mouse:up" events during free drawing mode.

This commit is contained in:
kangax 2012-06-22 17:05:07 +02:00
parent dd43c23e86
commit 5d803c9778
6 changed files with 15 additions and 9 deletions

View file

@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2012, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
var fabric = fabric || { version: "0.8.21" };
var fabric = fabric || { version: "0.8.22" };
if (typeof exports != 'undefined') {
exports.fabric = fabric;

9
dist/all.js vendored
View file

@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2012, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
var fabric = fabric || { version: "0.8.21" };
var fabric = fabric || { version: "0.8.22" };
if (typeof exports != 'undefined') {
exports.fabric = fabric;
@ -5939,6 +5939,7 @@ fabric.util.string = {
if (this.isDrawingMode && this._isCurrentlyDrawing) {
this._finalizeDrawingPath();
this.fire('mouse:up', { e: e });
return;
}
@ -5965,7 +5966,7 @@ fabric.util.string = {
}
this._currentTransform = null;
if (this._groupSelector) {
// group selection was completed, determine its bounds
this._findSelectedObjects(e);
@ -6015,6 +6016,7 @@ fabric.util.string = {
// capture coordinates immediately; this allows to draw dots (when movement never occurs)
this._captureDrawingPath(e);
this.fire('mouse:down', { e: e });
return;
}
@ -6025,7 +6027,7 @@ fabric.util.string = {
pointer = this.getPointer(e),
activeGroup = this.getActiveGroup(),
corner;
if (this._shouldClearSelection(e)) {
this._groupSelector = {
@ -6081,6 +6083,7 @@ fabric.util.string = {
if (this._isCurrentlyDrawing) {
this._captureDrawingPath(e);
}
this.fire('mouse:move', { e: e });
return;
}

4
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

View file

@ -1,7 +1,7 @@
{
"name": "fabric",
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
"version": "0.8.21",
"version": "0.8.22",
"author": "Juriy Zaytsev <kangax@gmail.com>",
"keywords": ["canvas", "graphic", "graphics", "SVG", "node-canvas", "parser", "HTML5", "object model"],
"repository": "git://github.com/kangax/fabric.js",

View file

@ -206,6 +206,7 @@
if (this.isDrawingMode && this._isCurrentlyDrawing) {
this._finalizeDrawingPath();
this.fire('mouse:up', { e: e });
return;
}
@ -232,7 +233,7 @@
}
this._currentTransform = null;
if (this._groupSelector) {
// group selection was completed, determine its bounds
this._findSelectedObjects(e);
@ -282,6 +283,7 @@
// capture coordinates immediately; this allows to draw dots (when movement never occurs)
this._captureDrawingPath(e);
this.fire('mouse:down', { e: e });
return;
}
@ -292,7 +294,7 @@
pointer = this.getPointer(e),
activeGroup = this.getActiveGroup(),
corner;
if (this._shouldClearSelection(e)) {
this._groupSelector = {
@ -348,6 +350,7 @@
if (this._isCurrentlyDrawing) {
this._captureDrawingPath(e);
}
this.fire('mouse:move', { e: e });
return;
}