fabric 5.4.2-browser → 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/CHANGELOG.md +4 -0
- package/README.md +12 -8
- package/dist/fabric.js +4 -8
- package/dist/fabric.min.js +1 -1
- package/package.json +1 -1
- package/src/shapes/object.class.js +0 -6
- package/src/shapes/text.class.js +4 -2
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "fabric",
|
|
3
3
|
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
|
|
4
4
|
"homepage": "http://fabricjs.com/",
|
|
5
|
-
"version": "5.
|
|
5
|
+
"version": "5.5.0-browser",
|
|
6
6
|
"author": "Juriy Zaytsev <kangax@gmail.com>",
|
|
7
7
|
"contributors": [
|
|
8
8
|
{
|
|
@@ -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);
|
package/src/shapes/text.class.js
CHANGED
|
@@ -433,8 +433,10 @@
|
|
|
433
433
|
this._splitText();
|
|
434
434
|
this._clearCache();
|
|
435
435
|
if (this.path) {
|
|
436
|
-
|
|
437
|
-
|
|
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;
|