Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Tom French 2014-07-09 20:12:38 +01:00
commit c40cada006
11 changed files with 1069 additions and 643 deletions

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "fabric.js",
"version": "1.4.7",
"version": "1.4.8",
"homepage": "http://fabricjs.com",
"authors": [
"kangax", "Kienz"

826
dist/fabric.js vendored

File diff suppressed because it is too large Load diff

14
dist/fabric.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/fabric.min.js.gz vendored

Binary file not shown.

826
dist/fabric.require.js vendored

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
"name": "fabric",
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
"homepage": "http://fabricjs.com/",
"version": "1.4.7",
"version": "1.4.8",
"author": "Juriy Zaytsev <kangax@gmail.com>",
"keywords": [
"canvas",

View file

@ -616,8 +616,8 @@
/**
* Rotates object by invoking its rotate method
* @private
* @param x {Number} pointer's x coordinate
* @param y {Number} pointer's y coordinate
* @param {Number} x pointer's x coordinate
* @param {Number} y pointer's y coordinate
*/
_rotateObject: function (x, y) {
@ -638,9 +638,11 @@
},
/**
* @private
* Set the cursor type of the canvas element
* @param {String} value Cursor type of the canvas element.
* @see http://www.w3.org/TR/css3-ui/#cursor
*/
_setCursor: function (value) {
setCursor: function (value) {
this.upperCanvasEl.style.cursor = value;
},

View file

@ -334,8 +334,8 @@
if (this.clipTo) {
fabric.util.clipContext(this, this.contextTop);
}
var ivt = fabric.util.invertTransform(this.viewportTransform);
var pointer = fabric.util.transformPoint(this.getPointer(e, true), ivt);
var ivt = fabric.util.invertTransform(this.viewportTransform),
pointer = fabric.util.transformPoint(this.getPointer(e, true), ivt);
this.freeDrawingBrush.onMouseDown(pointer);
this.fire('mouse:down', { e: e });
},
@ -350,7 +350,7 @@
pointer = fabric.util.transformPoint(this.getPointer(e, true), ivt);
this.freeDrawingBrush.onMouseMove(pointer);
}
this.upperCanvasEl.style.cursor = this.freeDrawingCursor;
this.setCursor(this.freeDrawingCursor);
this.fire('mouse:move', { e: e });
},
@ -529,7 +529,7 @@
target = this.findTarget(e);
if (!target || target && !target.selectable) {
this.upperCanvasEl.style.cursor = this.defaultCursor;
this.setCursor(this.defaultCursor);
}
else {
this._setCursorFromEvent(e, target);
@ -588,7 +588,7 @@
else {
this._translateObject(x, y);
this._fire('moving', target, e);
this._setCursor(this.moveCursor);
this.setCursor(this.moveCursor);
}
},
@ -646,10 +646,8 @@
* @param {Object} target Object that the mouse is hovering, if so.
*/
_setCursorFromEvent: function (e, target) {
var style = this.upperCanvasEl.style;
if (!target || !target.selectable) {
style.cursor = this.defaultCursor;
this.setCursor(this.defaultCursor);
return false;
}
else {
@ -660,7 +658,7 @@
&& target._findTargetCorner(this.getPointer(e, true));
if (!corner) {
style.cursor = target.hoverCursor || this.hoverCursor;
this.setCursor(target.hoverCursor || this.hoverCursor);
}
else {
this._setCornerCursor(corner, target);
@ -673,16 +671,14 @@
* @private
*/
_setCornerCursor: function(corner, target) {
var style = this.upperCanvasEl.style;
if (corner in cursorOffset) {
style.cursor = this._getRotatedCornerCursor(corner, target);
this.setCursor(this._getRotatedCornerCursor(corner, target));
}
else if (corner === 'mtr' && target.hasRotatingPoint) {
style.cursor = this.rotationCursor;
this.setCursor(this.rotationCursor);
}
else {
style.cursor = this.defaultCursor;
this.setCursor(this.defaultCursor);
return false;
}
},

View file

@ -186,7 +186,7 @@
if (activeGroup) {
activeGroup.setObjectsCoords().setCoords();
activeGroup.isMoving = false;
this._setCursor(this.defaultCursor);
this.setCursor(this.defaultCursor);
}
// clear selection and current transformation

View file

@ -1,7 +1,7 @@
(function(){
var degreesToRadians = fabric.util.degreesToRadians,
isVML = typeof G_vmlCanvasManager !== 'undefined';
isVML = function() { return typeof G_vmlCanvasManager !== 'undefined'; };
fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prototype */ {
@ -411,7 +411,7 @@
var size = this.cornerSize;
if (this.isControlVisible(control)) {
isVML || this.transparentCorners || ctx.clearRect(left, top, size, size);
isVML() || this.transparentCorners || ctx.clearRect(left, top, size, size);
ctx[methodName](left, top, size, size);
}
},