fabric 5.4.2 → 5.5.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/package.json CHANGED
@@ -1,92 +1,89 @@
1
1
  {
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.4.2",
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
- "canvas": "^2.8.0",
73
- "jsdom": "^19.0.0"
74
- },
75
- "devDependencies": {
76
- "auto-changelog": "^2.3.0",
77
- "chalk": "^2.4.1",
78
- "deep-object-diff": "^1.1.7",
79
- "eslint": "4.18.x",
80
- "nyc": "^15.1.0",
81
- "onchange": "^7.1.0",
82
- "pixelmatch": "^4.0.2",
83
- "qunit": "^2.17.2",
84
- "testem": "^3.2.0",
85
- "uglify-js": "3.3.x"
86
- },
87
- "engines": {
88
- "node": ">=14.0.0"
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.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
+ }
@@ -779,12 +779,6 @@
779
779
  additionalHeight = height * 0.1;
780
780
  }
781
781
  }
782
- if (this instanceof fabric.Text && this.path) {
783
- shouldRedraw = true;
784
- shouldResizeCanvas = true;
785
- additionalWidth += this.getHeightOfLine(0) * this.zoomX;
786
- additionalHeight += this.getHeightOfLine(0) * this.zoomY;
787
- }
788
782
  if (shouldRedraw) {
789
783
  if (shouldResizeCanvas) {
790
784
  canvas.width = Math.ceil(width + additionalWidth);
@@ -433,8 +433,10 @@
433
433
  this._splitText();
434
434
  this._clearCache();
435
435
  if (this.path) {
436
- this.width = this.path.width;
437
- this.height = this.path.height;
436
+ // Add the space of a line around the path. This is an approximation
437
+ var additionalWidth = this.getHeightOfLine(0) * 1.1;
438
+ this.width = this.path.width + additionalWidth;
439
+ this.height = this.path.height + additionalWidth;
438
440
  }
439
441
  else {
440
442
  this.width = this.calcTextWidth() || this.cursorWidth || this.MIN_TEXT_WIDTH;