fabric 5.5.0 → 5.5.1-browser
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/fabric.js +7 -20
- package/dist/fabric.min.js +1 -1
- package/package.json +88 -91
- package/src/shapes/object.class.js +7 -20
package/package.json
CHANGED
|
@@ -1,92 +1,89 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"main": "./dist/fabric.js",
|
|
91
|
-
"dependencies": {}
|
|
92
|
-
}
|
|
2
|
+
"name": "fabric",
|
|
3
|
+
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
|
|
4
|
+
"homepage": "http://fabricjs.com/",
|
|
5
|
+
"version": "5.5.1-browser",
|
|
6
|
+
"author": "Juriy Zaytsev <kangax@gmail.com>",
|
|
7
|
+
"contributors": [
|
|
8
|
+
{
|
|
9
|
+
"name": "Andrea Bogazzi",
|
|
10
|
+
"email": "andreabogazzi79@gmail.com"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "Steve Eberhardt",
|
|
14
|
+
"email": "melchiar2@gmail.com"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"canvas",
|
|
19
|
+
"graphic",
|
|
20
|
+
"graphics",
|
|
21
|
+
"SVG",
|
|
22
|
+
"node-canvas",
|
|
23
|
+
"parser",
|
|
24
|
+
"HTML5",
|
|
25
|
+
"object model"
|
|
26
|
+
],
|
|
27
|
+
"browser": {
|
|
28
|
+
"canvas": false,
|
|
29
|
+
"fs": false,
|
|
30
|
+
"jsdom": false,
|
|
31
|
+
"jsdom/lib/jsdom/living/generated/utils": false,
|
|
32
|
+
"jsdom/lib/jsdom/utils": false,
|
|
33
|
+
"http": false,
|
|
34
|
+
"https": false,
|
|
35
|
+
"xmldom": false,
|
|
36
|
+
"url": false
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/fabricjs/fabric.js"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/fabricjs/fabric.js/issues"
|
|
44
|
+
},
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"changelog": "auto-changelog -o change-output.md --unreleased-only",
|
|
48
|
+
"build": "node build.js modules=ALL requirejs exclude=gestures,accessors,erasing",
|
|
49
|
+
"build:fast": "node build.js modules=ALL requirejs fast exclude=gestures,accessors,erasing",
|
|
50
|
+
"build:watch": "onchange 'src/**/**' 'HEADER.js' 'lib/**/**' -- npm run build_export",
|
|
51
|
+
"link:watch": "onchange 'src/**/**' 'HEADER.js' 'lib/**/**' -- npm link",
|
|
52
|
+
"build_with_gestures": "node build.js modules=ALL exclude=accessors",
|
|
53
|
+
"build_export": "npm run build:fast && npm run export_dist_to_site",
|
|
54
|
+
"test:single": "qunit test/node_test_setup.js test/lib",
|
|
55
|
+
"test:coverage": "nyc --silent qunit test/node_test_setup.js test/lib test/unit",
|
|
56
|
+
"test:visual:coverage": "nyc --silent --no-clean qunit test/node_test_setup.js test/lib test/visual",
|
|
57
|
+
"coverage:report": "nyc report --reporter=lcov --reporter=text",
|
|
58
|
+
"test": "qunit --require ./test/node_test_setup.js test/lib test/unit",
|
|
59
|
+
"test:visual": "qunit test/node_test_setup.js test/lib test/visual",
|
|
60
|
+
"test:visual:single": "qunit test/node_test_setup.js test/lib",
|
|
61
|
+
"test:all": "npm run test && npm run test:visual",
|
|
62
|
+
"lint": "eslint --config .eslintrc.json src",
|
|
63
|
+
"lint_tests": "eslint test/unit --config .eslintrc_tests && eslint test/visual --config .eslintrc_tests",
|
|
64
|
+
"export_gesture_to_site": "cp dist/fabric.js ../fabricjs.com/lib/fabric_with_gestures.js",
|
|
65
|
+
"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/",
|
|
66
|
+
"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",
|
|
67
|
+
"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",
|
|
68
|
+
"testem": "testem .",
|
|
69
|
+
"testem:ci": "testem ci"
|
|
70
|
+
},
|
|
71
|
+
"optionalDependencies": {},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"auto-changelog": "^2.3.0",
|
|
74
|
+
"chalk": "^2.4.1",
|
|
75
|
+
"deep-object-diff": "^1.1.7",
|
|
76
|
+
"eslint": "4.18.x",
|
|
77
|
+
"nyc": "^15.1.0",
|
|
78
|
+
"onchange": "^7.1.0",
|
|
79
|
+
"pixelmatch": "^4.0.2",
|
|
80
|
+
"qunit": "^2.17.2",
|
|
81
|
+
"testem": "^3.2.0",
|
|
82
|
+
"uglify-js": "3.3.x"
|
|
83
|
+
},
|
|
84
|
+
"engines": {
|
|
85
|
+
"node": ">=14.0.0"
|
|
86
|
+
},
|
|
87
|
+
"main": "./dist/fabric.js",
|
|
88
|
+
"dependencies": {}
|
|
89
|
+
}
|
|
@@ -734,8 +734,8 @@
|
|
|
734
734
|
// for sure this ALIASING_LIMIT is slightly creating problem
|
|
735
735
|
// in situation in which the cache canvas gets an upper limit
|
|
736
736
|
// also objectScale contains already scaleX and scaleY
|
|
737
|
-
width: neededX + ALIASING_LIMIT,
|
|
738
|
-
height: neededY + ALIASING_LIMIT,
|
|
737
|
+
width: Math.ceil(neededX + ALIASING_LIMIT),
|
|
738
|
+
height: Math.ceil(neededY + ALIASING_LIMIT),
|
|
739
739
|
zoomX: objectScale.scaleX,
|
|
740
740
|
zoomY: objectScale.scaleY,
|
|
741
741
|
x: neededX,
|
|
@@ -760,29 +760,16 @@
|
|
|
760
760
|
}
|
|
761
761
|
var canvas = this._cacheCanvas,
|
|
762
762
|
dims = this._limitCacheSize(this._getCacheCanvasDimensions()),
|
|
763
|
-
minCacheSize = fabric.minCacheSideLimit,
|
|
764
763
|
width = dims.width, height = dims.height, drawingWidth, drawingHeight,
|
|
765
764
|
zoomX = dims.zoomX, zoomY = dims.zoomY,
|
|
766
765
|
dimensionsChanged = width !== this.cacheWidth || height !== this.cacheHeight,
|
|
767
766
|
zoomChanged = this.zoomX !== zoomX || this.zoomY !== zoomY,
|
|
768
|
-
shouldRedraw = dimensionsChanged || zoomChanged
|
|
769
|
-
|
|
770
|
-
if (dimensionsChanged) {
|
|
771
|
-
var canvasWidth = this._cacheCanvas.width,
|
|
772
|
-
canvasHeight = this._cacheCanvas.height,
|
|
773
|
-
sizeGrowing = width > canvasWidth || height > canvasHeight,
|
|
774
|
-
sizeShrinking = (width < canvasWidth * 0.9 || height < canvasHeight * 0.9) &&
|
|
775
|
-
canvasWidth > minCacheSize && canvasHeight > minCacheSize;
|
|
776
|
-
shouldResizeCanvas = sizeGrowing || sizeShrinking;
|
|
777
|
-
if (sizeGrowing && !dims.capped && (width > minCacheSize || height > minCacheSize)) {
|
|
778
|
-
additionalWidth = width * 0.1;
|
|
779
|
-
additionalHeight = height * 0.1;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
767
|
+
shouldRedraw = dimensionsChanged || zoomChanged;
|
|
768
|
+
|
|
782
769
|
if (shouldRedraw) {
|
|
783
|
-
if (
|
|
784
|
-
canvas.width =
|
|
785
|
-
canvas.height =
|
|
770
|
+
if (dimensionsChanged) {
|
|
771
|
+
canvas.width = width;
|
|
772
|
+
canvas.height = height;
|
|
786
773
|
}
|
|
787
774
|
else {
|
|
788
775
|
this._cacheContext.setTransform(1, 0, 0, 1, 0, 0);
|