Fix "mouse:down", "mouse:move", "mouse:up" events not firing during free drawing mode.

This commit is contained in:
kangax 2012-06-22 17:25:15 +02:00
parent d6f7c9effb
commit 9d36e26d71
6 changed files with 11 additions and 5 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;

5
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;
@ -5898,6 +5898,7 @@ fabric.util.string = {
if (this.isDrawingMode && this._isCurrentlyDrawing) {
this._finalizeDrawingPath();
this.fire('mouse:up', { e: e });
return;
}
@ -5973,6 +5974,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;
}
@ -6040,6 +6042,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;
}
@ -281,6 +282,7 @@
// capture coordinates immediately; this allows to draw dots (when movement never occurs)
this._captureDrawingPath(e);
this.fire('mouse:down', { e: e });
return;
}
@ -348,6 +350,7 @@
if (this._isCurrentlyDrawing) {
this._captureDrawingPath(e);
}
this.fire('mouse:move', { e: e });
return;
}