Build dist

This commit is contained in:
Juriy Zaytsev 2015-07-20 13:56:30 -04:00
parent 3907853048
commit f58197c3d8
4 changed files with 61 additions and 16 deletions

43
dist/fabric.js vendored
View file

@ -11358,7 +11358,8 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati
clipTo: this.clipTo && String(this.clipTo),
backgroundColor: this.backgroundColor,
fillRule: this.fillRule,
globalCompositeOperation: this.globalCompositeOperation
globalCompositeOperation: this.globalCompositeOperation,
transformMatrix: this.transformMatrix
};
if (!this.includeDefaultValues) {
@ -11392,6 +11393,13 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati
if (object[prop] === prototype[prop]) {
delete object[prop];
}
var isArray = Object.prototype.toString.call(object[prop]) === '[object Array]' &&
Object.prototype.toString.call(prototype[prop]) === '[object Array]';
// basically a check for [] === []
if (isArray && object[prop].length === 0 && prototype[prop].length === 0) {
delete object[prop];
}
});
return object;
@ -17189,7 +17197,11 @@ fabric.util.object.extend(fabric.Object.prototype, /** @lends fabric.Object.prot
});
var object = extend(this.callSuper('toObject', propertiesToInclude), {
src: this._originalElement.src || this._originalElement._src,
filters: filters
filters: filters,
crossOrigin: this.crossOrigin,
alignX: this.alignX,
alignY: this.alignY,
meetOrSlice: this.meetOrSlice
});
if (this.resizeFilters.length > 0) {
@ -23327,7 +23339,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
*/
_setSVGTextLineText: function(lineIndex, textSpans, height, textLeftOffset, textTopOffset, textBgRects) {
if (!this.styles[lineIndex]) {
this.callSuper('_setSVGTextLineText',
fabric.Text.prototype._setSVGTextLineText.call(this,
lineIndex, textSpans, height, textLeftOffset, textTopOffset);
}
else {
@ -23530,15 +23542,30 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
this._set('width', this.dynamicMinWidth);
}
// calculate a styleMap that lets us know where styles as, as _textLines is separated by \n and wraps,
// but the style object line indices is by \n.
this._styleMap = this._generateStyleMap();
// clear cache and re-calculate height
this._clearCache();
this.height = this._getTextHeight(ctx);
this._setLineWidths();
},
/**
* set the __lineWidths cache array to support
* functions that expect it to be filled
* @private
*/
_setLineWidths: function() {
for (var i = 0, len = this._textLines.length; i < len; i++) {
this.__lineWidths[i] = this.width;
}
},
/**
* Generate an object that translates the style object so that it is
* broken up by visual lines (new lines and automatic wrapping).
* The original text styles object is broken up by actual lines (new lines only),
* which is only sufficient for Text / IText
* @private
*/
_generateStyleMap: function() {
var realLineCount = 0,
realLineCharCount = 0,
@ -23767,6 +23794,8 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
var lines = this._wrapText(this.ctx, this.text);
this.ctx.restore();
this._textLines = lines;
this._styleMap = this._generateStyleMap();
return lines;
},

10
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.

View file

@ -5481,7 +5481,8 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
clipTo: this.clipTo && String(this.clipTo),
backgroundColor: this.backgroundColor,
fillRule: this.fillRule,
globalCompositeOperation: this.globalCompositeOperation
globalCompositeOperation: this.globalCompositeOperation,
transformMatrix: this.transformMatrix
};
if (!this.includeDefaultValues) {
object = this._removeDefaultValues(object);
@ -5498,6 +5499,10 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
if (object[prop] === prototype[prop]) {
delete object[prop];
}
var isArray = Object.prototype.toString.call(object[prop]) === "[object Array]" && Object.prototype.toString.call(prototype[prop]) === "[object Array]";
if (isArray && object[prop].length === 0 && prototype[prop].length === 0) {
delete object[prop];
}
});
return object;
},
@ -8179,7 +8184,11 @@ fabric.util.object.extend(fabric.Object.prototype, {
});
var object = extend(this.callSuper("toObject", propertiesToInclude), {
src: this._originalElement.src || this._originalElement._src,
filters: filters
filters: filters,
crossOrigin: this.crossOrigin,
alignX: this.alignX,
alignY: this.alignY,
meetOrSlice: this.meetOrSlice
});
if (this.resizeFilters.length > 0) {
object.resizeFilters = this.resizeFilters.map(function(filterObj) {
@ -11069,7 +11078,7 @@ fabric.util.object.extend(fabric.IText.prototype, {
fabric.util.object.extend(fabric.IText.prototype, {
_setSVGTextLineText: function(lineIndex, textSpans, height, textLeftOffset, textTopOffset, textBgRects) {
if (!this.styles[lineIndex]) {
this.callSuper("_setSVGTextLineText", lineIndex, textSpans, height, textLeftOffset, textTopOffset);
fabric.Text.prototype._setSVGTextLineText.call(this, lineIndex, textSpans, height, textLeftOffset, textTopOffset);
} else {
this._setSVGTextLineChars(lineIndex, textSpans, height, textLeftOffset, textBgRects);
}
@ -11148,9 +11157,14 @@ fabric.util.object.extend(fabric.IText.prototype, {
if (this.dynamicMinWidth > this.width) {
this._set("width", this.dynamicMinWidth);
}
this._styleMap = this._generateStyleMap();
this._clearCache();
this.height = this._getTextHeight(ctx);
this._setLineWidths();
},
_setLineWidths: function() {
for (var i = 0, len = this._textLines.length; i < len; i++) {
this.__lineWidths[i] = this.width;
}
},
_generateStyleMap: function() {
var realLineCount = 0, realLineCharCount = 0, charCount = 0, map = {};
@ -11265,6 +11279,8 @@ fabric.util.object.extend(fabric.IText.prototype, {
this._setTextStyles(this.ctx);
var lines = this._wrapText(this.ctx, this.text);
this.ctx.restore();
this._textLines = lines;
this._styleMap = this._generateStyleMap();
return lines;
},
setOnGroup: function(key, value) {