fabric 5.2.4 → 5.3.0-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/HEADER.js +1 -1
- package/dist/fabric.js +8 -6
- package/dist/fabric.min.js +1 -1
- package/package.json +88 -91
- package/src/filters/webgl_backend.class.js +4 -3
- package/src/mixins/itext_key_behavior.mixin.js +1 -1
- package/src/util/misc.js +2 -1
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.3.0-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
|
+
}
|
|
@@ -251,13 +251,14 @@
|
|
|
251
251
|
* @param {Number} width The width to initialize the texture at.
|
|
252
252
|
* @param {Number} height The height to initialize the texture.
|
|
253
253
|
* @param {HTMLImageElement|HTMLCanvasElement} textureImageSource A source for the texture data.
|
|
254
|
+
* @param {Number} filterType gl.NEAREST or gl.LINEAR usually, webgl numeri constants
|
|
254
255
|
* @returns {WebGLTexture}
|
|
255
256
|
*/
|
|
256
|
-
createTexture: function(gl, width, height, textureImageSource) {
|
|
257
|
+
createTexture: function(gl, width, height, textureImageSource, filterType) {
|
|
257
258
|
var texture = gl.createTexture();
|
|
258
259
|
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
259
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
|
|
260
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
|
|
260
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filterType || gl.NEAREST);
|
|
261
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filterType || gl.NEAREST);
|
|
261
262
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
262
263
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
263
264
|
if (textureImageSource) {
|
|
@@ -16,7 +16,7 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
|
|
|
16
16
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=870966
|
|
17
17
|
this.hiddenTextarea.style.cssText = 'position: absolute; top: ' + style.top +
|
|
18
18
|
'; left: ' + style.left + '; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px;' +
|
|
19
|
-
' padding
|
|
19
|
+
' padding-top: ' + style.fontSize + ';';
|
|
20
20
|
|
|
21
21
|
if (this.hiddenTextareaContainer) {
|
|
22
22
|
this.hiddenTextareaContainer.appendChild(this.hiddenTextarea);
|
package/src/util/misc.js
CHANGED
|
@@ -1235,6 +1235,7 @@
|
|
|
1235
1235
|
prevStyle.fontFamily !== thisStyle.fontFamily ||
|
|
1236
1236
|
prevStyle.fontWeight !== thisStyle.fontWeight ||
|
|
1237
1237
|
prevStyle.fontStyle !== thisStyle.fontStyle ||
|
|
1238
|
+
prevStyle.textBackgroundColor !== thisStyle.textBackgroundColor ||
|
|
1238
1239
|
prevStyle.deltaY !== thisStyle.deltaY) ||
|
|
1239
1240
|
(forTextSpans &&
|
|
1240
1241
|
(prevStyle.overline !== thisStyle.overline ||
|
|
@@ -1268,7 +1269,7 @@
|
|
|
1268
1269
|
charIndex++;
|
|
1269
1270
|
var thisStyle = styles[i][c];
|
|
1270
1271
|
//check if style exists for this character
|
|
1271
|
-
if (thisStyle) {
|
|
1272
|
+
if (thisStyle && Object.keys(thisStyle).length > 0) {
|
|
1272
1273
|
var styleChanged = fabric.util.hasStyleChanged(prevStyle, thisStyle, true);
|
|
1273
1274
|
if (styleChanged) {
|
|
1274
1275
|
stylesArray.push({
|