|
|
@@ -1,7 +1,7 @@ |
|
|
/* build: `node build.js modules=ALL exclude=json,gestures minifier=uglifyjs` */
|
|
|
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
|
|
|
|
|
|
-var fabric = fabric || { version: "1.7.14" };
|
|
|
+var fabric = fabric || { version: "1.7.15" };
|
|
|
if (typeof exports !== 'undefined') {
|
|
|
exports.fabric = fabric;
|
|
|
}
|
|
|
@@ -6850,14 +6850,14 @@ fabric.ElementsParser.prototype.checkIfDone = function() { |
|
|
* @chainable true
|
|
|
*/
|
|
|
setViewportTransform: function (vpt) {
|
|
|
- var activeGroup = this._activeGroup, object, ingoreVpt = false, skipAbsolute = true;
|
|
|
+ var activeGroup = this._activeGroup, object, ignoreVpt = false, skipAbsolute = true;
|
|
|
this.viewportTransform = vpt;
|
|
|
for (var i = 0, len = this._objects.length; i < len; i++) {
|
|
|
object = this._objects[i];
|
|
|
- object.group || object.setCoords(ingoreVpt, skipAbsolute);
|
|
|
+ object.group || object.setCoords(ignoreVpt, skipAbsolute);
|
|
|
}
|
|
|
if (activeGroup) {
|
|
|
- activeGroup.setCoords(ingoreVpt, skipAbsolute);
|
|
|
+ activeGroup.setCoords(ignoreVpt, skipAbsolute);
|
|
|
}
|
|
|
this.calcViewportBoundaries();
|
|
|
this.renderAll();
|
|
|
@@ -12654,15 +12654,15 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati |
|
|
if (shouldResizeCanvas) {
|
|
|
this._cacheCanvas.width = Math.max(Math.ceil(width) + additionalWidth, minCacheSize);
|
|
|
this._cacheCanvas.height = Math.max(Math.ceil(height) + additionalHeight, minCacheSize);
|
|
|
- this.cacheWidth = width;
|
|
|
- this.cacheHeight = height;
|
|
|
this.cacheTranslationX = (width + additionalWidth) / 2;
|
|
|
this.cacheTranslationY = (height + additionalHeight) / 2;
|
|
|
}
|
|
|
else {
|
|
|
this._cacheContext.setTransform(1, 0, 0, 1, 0, 0);
|
|
|
this._cacheContext.clearRect(0, 0, this._cacheCanvas.width, this._cacheCanvas.height);
|
|
|
}
|
|
|
+ this.cacheWidth = width;
|
|
|
+ this.cacheHeight = height;
|
|
|
this._cacheContext.translate(this.cacheTranslationX, this.cacheTranslationY);
|
|
|
this._cacheContext.scale(zoomX, zoomY);
|
|
|
this.zoomX = zoomX;
|
|
|
@@ -12981,7 +12981,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati |
|
|
* @return {Boolean}
|
|
|
*/
|
|
|
willDrawShadow: function() {
|
|
|
- return !!this.shadow;
|
|
|
+ return !!this.shadow && (this.shadow.offsetX !== 0 || this.shadow.offsetY !== 0);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -18610,7 +18610,7 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot |
|
|
* @return {Boolean}
|
|
|
*/
|
|
|
willDrawShadow: function() {
|
|
|
- if (this.shadow) {
|
|
|
+ if (this.callSuper('willDrawShadow')) {
|
|
|
return true;
|
|
|
}
|
|
|
for (var i = 0, len = this._objects.length; i < len; i++) {
|
|
|
@@ -25389,9 +25389,17 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot |
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @private
|
|
|
+ * For functionalities on keyDown
|
|
|
+ * Map a special key to a function of the instance/prototype
|
|
|
+ * If you need different behaviour for ESC or TAB or arrows, you have to change
|
|
|
+ * this map setting the name of a function that you build on the fabric.Itext or
|
|
|
+ * your prototype.
|
|
|
+ * the map change will affect all Instances unless you need for only some text Instances
|
|
|
+ * in that case you have to clone this object and assign your Instance.
|
|
|
+ * this.keysMap = fabric.util.object.clone(this.keysMap);
|
|
|
+ * The function must be in fabric.Itext.prototype.myFunction And will receive event as args[0]
|
|
|
*/
|
|
|
- _keysMap: {
|
|
|
+ keysMap: {
|
|
|
8: 'removeChars',
|
|
|
9: 'exitEditing',
|
|
|
27: 'exitEditing',
|
|
|
@@ -25408,17 +25416,17 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot |
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @private
|
|
|
+ * For functionalities on keyUp + ctrl || cmd
|
|
|
*/
|
|
|
- _ctrlKeysMapUp: {
|
|
|
+ ctrlKeysMapUp: {
|
|
|
67: 'copy',
|
|
|
88: 'cut'
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * @private
|
|
|
+ * For functionalities on keyDown + ctrl || cmd
|
|
|
*/
|
|
|
- _ctrlKeysMapDown: {
|
|
|
+ ctrlKeysMapDown: {
|
|
|
65: 'selectAll'
|
|
|
},
|
|
|
|
|
|
@@ -25435,11 +25443,11 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot |
|
|
if (!this.isEditing) {
|
|
|
return;
|
|
|
}
|
|
|
- if (e.keyCode in this._keysMap) {
|
|
|
- this[this._keysMap[e.keyCode]](e);
|
|
|
+ if (e.keyCode in this.keysMap) {
|
|
|
+ this[this.keysMap[e.keyCode]](e);
|
|
|
}
|
|
|
- else if ((e.keyCode in this._ctrlKeysMapDown) && (e.ctrlKey || e.metaKey)) {
|
|
|
- this[this._ctrlKeysMapDown[e.keyCode]](e);
|
|
|
+ else if ((e.keyCode in this.ctrlKeysMapDown) && (e.ctrlKey || e.metaKey)) {
|
|
|
+ this[this.ctrlKeysMapDown[e.keyCode]](e);
|
|
|
}
|
|
|
else {
|
|
|
return;
|
|
|
@@ -25467,8 +25475,8 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot |
|
|
this._copyDone = false;
|
|
|
return;
|
|
|
}
|
|
|
- if ((e.keyCode in this._ctrlKeysMapUp) && (e.ctrlKey || e.metaKey)) {
|
|
|
- this[this._ctrlKeysMapUp[e.keyCode]](e);
|
|
|
+ if ((e.keyCode in this.ctrlKeysMapUp) && (e.ctrlKey || e.metaKey)) {
|
|
|
+ this[this.ctrlKeysMapUp[e.keyCode]](e);
|
|
|
}
|
|
|
else {
|
|
|
return;
|
0 comments on commit
4cb2e32