mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-05 04:14:54 +00:00
build dist
This commit is contained in:
parent
dde9eaa4e3
commit
57439eaded
4 changed files with 43 additions and 14 deletions
25
dist/fabric.js
vendored
25
dist/fabric.js
vendored
|
|
@ -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
14
dist/fabric.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/fabric.min.js.gz
vendored
BIN
dist/fabric.min.js.gz
vendored
Binary file not shown.
18
dist/fabric.require.js
vendored
18
dist/fabric.require.js
vendored
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue