build dist

This commit is contained in:
Andrea Bogazzi 2016-07-17 12:02:12 +02:00
parent dde9eaa4e3
commit 57439eaded
4 changed files with 43 additions and 14 deletions

25
dist/fabric.js vendored
View file

@ -5438,11 +5438,18 @@ fabric.ElementsParser.prototype.checkIfDone = function() {
*/
var colorStopEls = el.getElementsByTagName('stop'),
type = (el.nodeName === 'linearGradient' ? 'linear' : 'radial'),
type,
gradientUnits = el.getAttribute('gradientUnits') || 'objectBoundingBox',
gradientTransform = el.getAttribute('gradientTransform'),
colorStops = [],
coords = { }, ellipseMatrix;
coords, ellipseMatrix;
if (el.nodeName === 'linearGradient' || el.nodeName === 'LINEARGRADIENT') {
type = 'linear';
}
else {
type = 'radial';
}
if (type === 'linear') {
coords = getLinearCoords(el);
@ -5492,6 +5499,12 @@ fabric.ElementsParser.prototype.checkIfDone = function() {
function _convertPercentUnitsToValues(object, options, gradientUnits) {
var propValue, addFactor = 0, multFactor = 1, ellipseMatrix = '';
for (var prop in options) {
if (options[prop] === 'Infinity') {
options[prop] = 1;
}
else if (options[prop] === '-Infinity') {
options[prop] = 0;
}
propValue = parseFloat(options[prop], 10);
if (typeof options[prop] === 'string' && /^\d+%$/.test(options[prop])) {
multFactor = 0.01;
@ -8315,9 +8328,13 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, /** @lends fab
* Creates path
*/
createPath: function(pathData) {
var path = this.callSuper('createPath', pathData);
var path = this.callSuper('createPath', pathData),
topLeft = path._getLeftTopCoords().scalarAdd(path.strokeWidth / 2);
path.stroke = new fabric.Pattern({
source: this.source || this.getPatternSrcFunction()
source: this.source || this.getPatternSrcFunction(),
offsetX: -topLeft.x,
offsetY: -topLeft.y
});
return path;
}

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.

View file

@ -2877,7 +2877,12 @@ fabric.ElementsParser.prototype.checkIfDone = function() {
});
fabric.util.object.extend(fabric.Gradient, {
fromElement: function(el, instance) {
var colorStopEls = el.getElementsByTagName("stop"), type = el.nodeName === "linearGradient" ? "linear" : "radial", gradientUnits = el.getAttribute("gradientUnits") || "objectBoundingBox", gradientTransform = el.getAttribute("gradientTransform"), colorStops = [], coords = {}, ellipseMatrix;
var colorStopEls = el.getElementsByTagName("stop"), type, gradientUnits = el.getAttribute("gradientUnits") || "objectBoundingBox", gradientTransform = el.getAttribute("gradientTransform"), colorStops = [], coords, ellipseMatrix;
if (el.nodeName === "linearGradient" || el.nodeName === "LINEARGRADIENT") {
type = "linear";
} else {
type = "radial";
}
if (type === "linear") {
coords = getLinearCoords(el);
} else if (type === "radial") {
@ -2908,6 +2913,11 @@ fabric.ElementsParser.prototype.checkIfDone = function() {
function _convertPercentUnitsToValues(object, options, gradientUnits) {
var propValue, addFactor = 0, multFactor = 1, ellipseMatrix = "";
for (var prop in options) {
if (options[prop] === "Infinity") {
options[prop] = 1;
} else if (options[prop] === "-Infinity") {
options[prop] = 0;
}
propValue = parseFloat(options[prop], 10);
if (typeof options[prop] === "string" && /^\d+%$/.test(options[prop])) {
multFactor = .01;
@ -4174,9 +4184,11 @@ fabric.PatternBrush = fabric.util.createClass(fabric.PencilBrush, {
this.canvas.contextTop.strokeStyle = this.getPattern();
},
createPath: function(pathData) {
var path = this.callSuper("createPath", pathData);
var path = this.callSuper("createPath", pathData), topLeft = path._getLeftTopCoords().scalarAdd(path.strokeWidth / 2);
path.stroke = new fabric.Pattern({
source: this.source || this.getPatternSrcFunction()
source: this.source || this.getPatternSrcFunction(),
offsetX: -topLeft.x,
offsetY: -topLeft.y
});
return path;
}