Comparing version 3.6.0 to 3.6.1-browser
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */ | ||
var fabric = fabric || { version: '3.6.0' }; | ||
var fabric = fabric || { version: '3.6.1' }; | ||
if (typeof exports !== 'undefined') { | ||
@@ -5,0 +5,0 @@ exports.fabric = fabric; |
157
package.json
{ | ||
"name": "fabric", | ||
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.", | ||
"homepage": "http://fabricjs.com/", | ||
"version": "3.6.0", | ||
"authors": "Juriy Zaytsev <kangax@gmail.com>", | ||
"contributors": [ | ||
{ | ||
"name": "Andrea Bogazzi", | ||
"email": "andreabogazzi79@gmail.com" | ||
} | ||
], | ||
"keywords": [ | ||
"canvas", | ||
"graphic", | ||
"graphics", | ||
"SVG", | ||
"node-canvas", | ||
"parser", | ||
"HTML5", | ||
"object model" | ||
], | ||
"browser": { | ||
"canvas": false, | ||
"fs": false, | ||
"jsdom": false, | ||
"jsdom/lib/jsdom/living/generated/utils": false, | ||
"jsdom/lib/jsdom/utils": false, | ||
"http": false, | ||
"https": false, | ||
"xmldom": false, | ||
"url": false | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/fabricjs/fabric.js" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/fabricjs/fabric.js/issues" | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "node build.js modules=ALL requirejs exclude=gestures,accessors", | ||
"build:fast": "node build.js modules=ALL requirejs fast exclude=gestures,accessors", | ||
"build:watch": "onchange 'src/**/**' 'HEADER.js' 'lib/**/**' -- npm run build_export", | ||
"build_with_gestures": "node build.js modules=ALL exclude=accessors", | ||
"build_export": "npm run build:fast && npm run export_dist_to_site", | ||
"test:single": "qunit test/node_test_setup.js test/lib", | ||
"test": "nyc qunit test/node_test_setup.js test/lib test/unit", | ||
"test:visual": "qunit test/node_test_setup.js test/lib test/visual", | ||
"test:visual:single": "qunit test/node_test_setup.js test/lib", | ||
"test:all": "npm run test && npm run test:visual", | ||
"lint": "eslint --config .eslintrc.json src", | ||
"lint_tests": "eslint test/unit --config .eslintrc_tests && eslint test/visual --config .eslintrc_tests", | ||
"export_dist_to_site": "cp dist/fabric.js ../fabricjs.com/lib/fabric.js && cp package.json ../fabricjs.com/lib/package.json && cp -r src HEADER.js lib ../fabricjs.com/build/files/", | ||
"export_tests_to_site": "cp test/unit/*.js ../fabricjs.com/test/unit && cp -r test/visual/* ../fabricjs.com/test/visual && cp -r test/fixtures/* ../fabricjs.com/test/fixtures && cp -r test/lib/* ../fabricjs.com/test/lib", | ||
"all": "npm run build && npm run test && npm run test:visual && npm run lint && npm run lint_tests && npm run export_dist_to_site && npm run export_tests_to_site", | ||
"testem": "testem .", | ||
"testem:visual": "testem --file testem-visual.json", | ||
"testem:ci": "testem ci" | ||
}, | ||
"optionalDependencies": { | ||
"canvas": "^2.6.1", | ||
"jsdom": "^15.1.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "4.18.x", | ||
"nyc": "13.3.x", | ||
"onchange": "^3.x.x", | ||
"qunit": "2.9.2", | ||
"testem": "^1.18.4", | ||
"uglify-js": "3.3.x", | ||
"pixelmatch": "^4.0.2", | ||
"chalk": "^2.4.1" | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
"main": "./dist/fabric.js", | ||
"dependencies": {} | ||
} | ||
"name": "fabric", | ||
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.", | ||
"homepage": "http://fabricjs.com/", | ||
"version": "3.6.1-browser", | ||
"authors": "Juriy Zaytsev <kangax@gmail.com>", | ||
"contributors": [ | ||
{ | ||
"name": "Andrea Bogazzi", | ||
"email": "andreabogazzi79@gmail.com" | ||
} | ||
], | ||
"keywords": [ | ||
"canvas", | ||
"graphic", | ||
"graphics", | ||
"SVG", | ||
"node-canvas", | ||
"parser", | ||
"HTML5", | ||
"object model" | ||
], | ||
"browser": { | ||
"canvas": false, | ||
"fs": false, | ||
"jsdom": false, | ||
"jsdom/lib/jsdom/living/generated/utils": false, | ||
"jsdom/lib/jsdom/utils": false, | ||
"http": false, | ||
"https": false, | ||
"xmldom": false, | ||
"url": false | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/fabricjs/fabric.js" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/fabricjs/fabric.js/issues" | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "node build.js modules=ALL requirejs exclude=gestures,accessors", | ||
"build:fast": "node build.js modules=ALL requirejs fast exclude=gestures,accessors", | ||
"build:watch": "onchange 'src/**/**' 'HEADER.js' 'lib/**/**' -- npm run build_export", | ||
"build_with_gestures": "node build.js modules=ALL exclude=accessors", | ||
"build_export": "npm run build:fast && npm run export_dist_to_site", | ||
"test:single": "qunit test/node_test_setup.js test/lib", | ||
"test": "nyc qunit test/node_test_setup.js test/lib test/unit", | ||
"test:visual": "qunit test/node_test_setup.js test/lib test/visual", | ||
"test:visual:single": "qunit test/node_test_setup.js test/lib", | ||
"test:all": "npm run test && npm run test:visual", | ||
"lint": "eslint --config .eslintrc.json src", | ||
"lint_tests": "eslint test/unit --config .eslintrc_tests && eslint test/visual --config .eslintrc_tests", | ||
"export_dist_to_site": "cp dist/fabric.js ../fabricjs.com/lib/fabric.js && cp package.json ../fabricjs.com/lib/package.json && cp -r src HEADER.js lib ../fabricjs.com/build/files/", | ||
"export_tests_to_site": "cp test/unit/*.js ../fabricjs.com/test/unit && cp -r test/visual/* ../fabricjs.com/test/visual && cp -r test/fixtures/* ../fabricjs.com/test/fixtures && cp -r test/lib/* ../fabricjs.com/test/lib", | ||
"all": "npm run build && npm run test && npm run test:visual && npm run lint && npm run lint_tests && npm run export_dist_to_site && npm run export_tests_to_site", | ||
"testem": "testem .", | ||
"testem:visual": "testem --file testem-visual.json", | ||
"testem:ci": "testem ci" | ||
}, | ||
"optionalDependencies": {}, | ||
"devDependencies": { | ||
"eslint": "4.18.x", | ||
"nyc": "13.3.x", | ||
"onchange": "^3.x.x", | ||
"qunit": "2.9.2", | ||
"testem": "^1.18.4", | ||
"uglify-js": "3.3.x", | ||
"pixelmatch": "^4.0.2", | ||
"chalk": "^2.4.1" | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
"main": "./dist/fabric.js", | ||
"dependencies": {} | ||
} |
@@ -276,3 +276,3 @@ (function(global) { | ||
// eslint-disable-next-line max-depth | ||
if (scy < 0 || scy > sh || scx < 0 || scx > sw) { | ||
if (scy < 0 || scy >= sh || scx < 0 || scx >= sw) { | ||
continue; | ||
@@ -279,0 +279,0 @@ } |
@@ -320,6 +320,9 @@ (function() { | ||
* @param {CanvasRenderingContext2D} ctx Context to render on | ||
* @param {fabric.Object} object the fabric.Object for which the gradient is | ||
* @return {CanvasGradient} | ||
*/ | ||
toLive: function(ctx) { | ||
var gradient, coords = fabric.util.object.clone(this.coords), i, len; | ||
toLive: function(ctx, object) { | ||
var gradient, coords = fabric.util.object.clone(this.coords), i, len, | ||
x1 = coords.x1, y1 = coords.y1, x2 = coords.x2, y2 = coords.y2, | ||
stops = this.colorStops; | ||
@@ -330,16 +333,19 @@ if (!this.type) { | ||
if (object instanceof fabric.Text && this.gradientUnits === 'percentage') { | ||
x1 *= object.width; | ||
y1 *= object.height; | ||
x2 *= object.width; | ||
y2 *= object.height; | ||
} | ||
if (this.type === 'linear') { | ||
gradient = ctx.createLinearGradient( | ||
coords.x1, coords.y1, coords.x2, coords.y2); | ||
gradient = ctx.createLinearGradient(x1, y1, x2, y2); | ||
} | ||
else if (this.type === 'radial') { | ||
gradient = ctx.createRadialGradient( | ||
coords.x1, coords.y1, coords.r1, coords.x2, coords.y2, coords.r2); | ||
gradient = ctx.createRadialGradient(x1, y1, coords.r1, x2, y2, coords.r2); | ||
} | ||
for (i = 0, len = stops.length; i < len; i++) { | ||
var color = stops[i].color, | ||
opacity = stops[i].opacity, | ||
offset = stops[i].offset; | ||
for (i = 0, len = this.colorStops.length; i < len; i++) { | ||
var color = this.colorStops[i].color, | ||
opacity = this.colorStops[i].opacity, | ||
offset = this.colorStops[i].offset; | ||
if (typeof opacity !== 'undefined') { | ||
@@ -346,0 +352,0 @@ color = new fabric.Color(color).setAlpha(opacity).toRgba(); |
@@ -576,4 +576,6 @@ (function() { | ||
* Calculate object bounding box dimensions from its properties scale, skew. | ||
* @param {Number} skewX, a value to override current skewX | ||
* @param {Number} skewY, a value to override current skewY | ||
* The skewX and skewY parameters are used in the skewing logic path and | ||
* do not provide something useful to common use cases. | ||
* @param {Number} [skewX], a value to override current skewX | ||
* @param {Number} [skewY], a value to override current skewY | ||
* @private | ||
@@ -628,4 +630,4 @@ * @return {Object} .x width dimension | ||
scaleY: this.scaleY, | ||
skewX: this.skewX, | ||
skewY: this.skewY, | ||
skewX: skewX, | ||
skewY: skewY, | ||
}), | ||
@@ -632,0 +634,0 @@ bbox = fabric.util.makeBoundingBoxFromPoints(points, transformMatrix); |
@@ -823,2 +823,20 @@ (function(global) { | ||
* @param {CanvasRenderingContext2D} ctx Context to render on | ||
* @param {Object} filler fabric.Pattern or fabric.Gradient | ||
* @return {Object} offset.offsetX offset for text rendering | ||
* @return {Object} offset.offsetY offset for text rendering | ||
*/ | ||
_applyPatternGradientTransform: function(ctx, filler) { | ||
if (!filler || !filler.toLive) { | ||
return { offsetX: 0, offsetY: 0 }; | ||
} | ||
var offsetX = -this.width / 2 + filler.offsetX || 0, | ||
offsetY = -this.height / 2 + filler.offsetY || 0; | ||
ctx.transform(1, 0, 0, 1, offsetX, offsetY); | ||
return { offsetX: offsetX, offsetY: offsetY }; | ||
}, | ||
/** | ||
* @private | ||
* @param {CanvasRenderingContext2D} ctx Context to render on | ||
* @param {String} method Method name ("fillText" or "strokeText") | ||
@@ -825,0 +843,0 @@ */ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2391935
0
56462
2