Comparing version 5.3.0 to 5.4.0-browser
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */ | ||
var fabric = fabric || { version: '5.3.0' }; | ||
var fabric = fabric || { version: '5.4.0' }; | ||
if (typeof exports !== 'undefined') { | ||
@@ -5,0 +5,0 @@ exports.fabric = fabric; |
179
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": "5.3.0", | ||
"author": "Juriy Zaytsev <kangax@gmail.com>", | ||
"contributors": [ | ||
{ | ||
"name": "Andrea Bogazzi", | ||
"email": "andreabogazzi79@gmail.com" | ||
}, | ||
{ | ||
"name": "Steve Eberhardt", | ||
"email": "melchiar2@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": { | ||
"changelog": "auto-changelog -o change-output.md --unreleased-only", | ||
"build": "node build.js modules=ALL requirejs exclude=gestures,accessors,erasing", | ||
"build:fast": "node build.js modules=ALL requirejs fast exclude=gestures,accessors,erasing", | ||
"build:watch": "onchange 'src/**/**' 'HEADER.js' 'lib/**/**' -- npm run build_export", | ||
"link:watch": "onchange 'src/**/**' 'HEADER.js' 'lib/**/**' -- npm link", | ||
"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:coverage": "nyc --silent qunit test/node_test_setup.js test/lib test/unit", | ||
"test:visual:coverage": "nyc --silent --no-clean qunit test/node_test_setup.js test/lib test/visual", | ||
"coverage:report": "nyc report --reporter=lcov --reporter=text", | ||
"test": "qunit --require ./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_gesture_to_site": "cp dist/fabric.js ../fabricjs.com/lib/fabric_with_gestures.js", | ||
"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:ci": "testem ci" | ||
}, | ||
"optionalDependencies": { | ||
"canvas": "^2.8.0", | ||
"jsdom": "^19.0.0" | ||
}, | ||
"devDependencies": { | ||
"auto-changelog": "^2.3.0", | ||
"chalk": "^2.4.1", | ||
"deep-object-diff": "^1.1.7", | ||
"eslint": "4.18.x", | ||
"nyc": "^15.1.0", | ||
"onchange": "^7.1.0", | ||
"pixelmatch": "^4.0.2", | ||
"qunit": "^2.17.2", | ||
"testem": "^3.2.0", | ||
"uglify-js": "3.3.x" | ||
}, | ||
"engines": { | ||
"node": ">=14.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": "5.4.0-browser", | ||
"author": "Juriy Zaytsev <kangax@gmail.com>", | ||
"contributors": [ | ||
{ | ||
"name": "Andrea Bogazzi", | ||
"email": "andreabogazzi79@gmail.com" | ||
}, | ||
{ | ||
"name": "Steve Eberhardt", | ||
"email": "melchiar2@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": { | ||
"changelog": "auto-changelog -o change-output.md --unreleased-only", | ||
"build": "node build.js modules=ALL requirejs exclude=gestures,accessors,erasing", | ||
"build:fast": "node build.js modules=ALL requirejs fast exclude=gestures,accessors,erasing", | ||
"build:watch": "onchange 'src/**/**' 'HEADER.js' 'lib/**/**' -- npm run build_export", | ||
"link:watch": "onchange 'src/**/**' 'HEADER.js' 'lib/**/**' -- npm link", | ||
"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:coverage": "nyc --silent qunit test/node_test_setup.js test/lib test/unit", | ||
"test:visual:coverage": "nyc --silent --no-clean qunit test/node_test_setup.js test/lib test/visual", | ||
"coverage:report": "nyc report --reporter=lcov --reporter=text", | ||
"test": "qunit --require ./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_gesture_to_site": "cp dist/fabric.js ../fabricjs.com/lib/fabric_with_gestures.js", | ||
"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:ci": "testem ci" | ||
}, | ||
"optionalDependencies": {}, | ||
"devDependencies": { | ||
"auto-changelog": "^2.3.0", | ||
"chalk": "^2.4.1", | ||
"deep-object-diff": "^1.1.7", | ||
"eslint": "4.18.x", | ||
"nyc": "^15.1.0", | ||
"onchange": "^7.1.0", | ||
"pixelmatch": "^4.0.2", | ||
"qunit": "^2.17.2", | ||
"testem": "^3.2.0", | ||
"uglify-js": "3.3.x" | ||
}, | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"main": "./dist/fabric.js", | ||
"dependencies": {} | ||
} |
@@ -151,4 +151,4 @@ (function() { | ||
this._hoveredTargets.forEach(function(_target){ | ||
_this.fire('mouse:out', { target: target, e: e }); | ||
_target && target.fire('mouseout', { e: e }); | ||
_this.fire('mouse:out', { target: _target, e: e }); | ||
_target && _target.fire('mouseout', { e: e }); | ||
}); | ||
@@ -155,0 +155,0 @@ this._hoveredTargets = []; |
@@ -743,4 +743,5 @@ (function() { | ||
newLineStyles = {}, | ||
somethingAdded = false, | ||
isEndOfLine = this._unwrappedTextLines[lineIndex].length === charIndex; | ||
someStyleIsCarryingOver = false, | ||
originalLineLength = this._unwrappedTextLines[lineIndex].length, | ||
isEndOfLine = originalLineLength === charIndex; | ||
@@ -757,3 +758,3 @@ qty || (qty = 1); | ||
if (numIndex >= charIndex) { | ||
somethingAdded = true; | ||
someStyleIsCarryingOver = true; | ||
newLineStyles[numIndex - charIndex] = this.styles[lineIndex][index]; | ||
@@ -767,3 +768,3 @@ // remove lines from the previous line since they're on a new line now | ||
var styleCarriedOver = false; | ||
if (somethingAdded && !isEndOfLine) { | ||
if (someStyleIsCarryingOver && !isEndOfLine) { | ||
// if is end of line, the extra style we copied | ||
@@ -774,4 +775,6 @@ // is probably not something we want | ||
} | ||
if (styleCarriedOver) { | ||
// skip the last line of since we already prepared it. | ||
if (styleCarriedOver || originalLineLength > charIndex) { | ||
// skip the last line of since we already prepared it | ||
// or contains text without style that we don't want to style | ||
// just because it changed lines | ||
qty--; | ||
@@ -778,0 +781,0 @@ } |
@@ -214,3 +214,6 @@ (function() { | ||
ctx.save(); | ||
var retinaScaling = this.canvas.getRetinaScaling(), matrix, p; | ||
var retinaScaling = 1, matrix, p; | ||
if (this.canvas) { | ||
retinaScaling = this.canvas.getRetinaScaling(); | ||
} | ||
ctx.setTransform(retinaScaling, 0, 0, retinaScaling, 0, 0); | ||
@@ -217,0 +220,0 @@ ctx.strokeStyle = ctx.fillStyle = styleOverride.cornerColor || this.cornerColor; |
@@ -180,3 +180,3 @@ (function() { | ||
} | ||
selectionStart -= lines[i].length + this.missingNewlineOffset(i); | ||
selectionStart -= lines[i].length + this.missingNewlineOffset(i, skipWrapping); | ||
} | ||
@@ -183,0 +183,0 @@ return { |
@@ -128,3 +128,2 @@ (function(global) { | ||
ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1; | ||
this.callSuper('_renderControls', ctx, styleOverride); | ||
childrenOverride = childrenOverride || { }; | ||
@@ -138,2 +137,3 @@ if (typeof childrenOverride.hasControls === 'undefined') { | ||
} | ||
this.callSuper('_renderControls', ctx, styleOverride); | ||
ctx.restore(); | ||
@@ -140,0 +140,0 @@ }, |
@@ -516,2 +516,3 @@ (function() { | ||
var objCopy = Object.assign({}, object, { styles: styles }); | ||
delete objCopy.path; | ||
parseDecoration(objCopy); | ||
@@ -525,4 +526,14 @@ if (objCopy.styles) { | ||
} | ||
fabric.Object._fromObject('IText', objCopy, callback, 'text'); | ||
fabric.Object._fromObject('IText', objCopy, function(textInstance) { | ||
if (object.path) { | ||
fabric.Object._fromObject('Path', object.path, function(pathInstance) { | ||
textInstance.set('path', pathInstance); | ||
callback(textInstance); | ||
}, 'path'); | ||
} | ||
else { | ||
callback(textInstance); | ||
} | ||
}, 'text'); | ||
}; | ||
})(); |
@@ -1356,2 +1356,7 @@ (function(global) { | ||
} | ||
ctx.save(); | ||
// if type is overline or linethrough we shouldn't cast shadow | ||
if (type === 'overline' || type === 'linethrough') { | ||
this._removeShadow(ctx); | ||
} | ||
var heightOfLine, size, _size, | ||
@@ -1443,5 +1448,3 @@ lineLeftOffset, dy, _dy, | ||
} | ||
// if there is text background color no | ||
// other shadows should be casted | ||
this._removeShadow(ctx); | ||
ctx.restore(); | ||
}, | ||
@@ -1448,0 +1451,0 @@ |
@@ -391,6 +391,8 @@ (function(global) { | ||
* and counting style. | ||
* This is important only for splitByGrapheme at the end of wrapping. | ||
* If we are not wrapping the offset is always 1 | ||
* @return Number | ||
*/ | ||
missingNewlineOffset: function(lineIndex) { | ||
if (this.splitByGrapheme) { | ||
missingNewlineOffset: function(lineIndex, skipWrapping) { | ||
if (this.splitByGrapheme && !skipWrapping) { | ||
return this.isEndOfWrapping(lineIndex) ? 1 : 0; | ||
@@ -460,4 +462,15 @@ } | ||
var objCopy = Object.assign({}, object, { styles: styles }); | ||
return fabric.Object._fromObject('Textbox', objCopy, callback, 'text'); | ||
delete objCopy.path; | ||
return fabric.Object._fromObject('Textbox', objCopy, function(textInstance) { | ||
if (object.path) { | ||
fabric.Object._fromObject('Path', object.path, function(pathInstance) { | ||
textInstance.set('path', pathInstance); | ||
callback(textInstance); | ||
}, 'path'); | ||
} | ||
else { | ||
callback(textInstance); | ||
} | ||
}, 'text'); | ||
}; | ||
})(typeof exports !== 'undefined' ? exports : this); |
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
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
2607628
0
60323
2