fabric 5.4.2 → 5.5.0

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.5.0]
4
+
5
+ - refactor() Possibly breaking: Include text line height in text on a path size calculation to avoid cut off from cache. [`#10355`](https://github.com/fabricjs/fabric.js/pull/10355)
6
+
3
7
  ## [5.4.2]
4
8
 
5
9
  - fix() Use correct Path context when creating the svg for the path [`#10276`](https://github.com/fabricjs/fabric.js/pull/10276)
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Fabric.js
2
2
 
3
+ If you are still using Fabric.js v5 because you are maintaining a complex project you don't want to migrate, we made an effort to keep old documentation online.
4
+ Please keep in mind the Fabric.js development team moved on to v6 and beyond and does not have time to keep updated 2 versions.
5
+ All the resources of Fabric.js v5 are deployed [here](https://fabric5.fabricjs.com)] while (fabricjs.com)[https://fabricjs.com] focuses on v6 onward.
6
+
3
7
  <!-- build/coverage status, climate -->
4
8
 
5
9
  [![Build Status](https://secure.travis-ci.org/fabricjs/fabric.js.svg?branch=master)](http://travis-ci.org/#!/kangax/fabric.js)
@@ -21,7 +25,7 @@
21
25
 
22
26
  **Fabric.js** is a framework that makes it easy to work with HTML5 canvas element. It is an **interactive object model** on top of canvas element. It is also an **SVG-to-canvas parser**.
23
27
 
24
- <a href="http://fabricjs.com/kitchensink" target="_blank"><img src="https://github.com/kangax/fabric.js/raw/master/lib/screenshot.png" style="width:300px;box-shadow:rgba(0,0,0,0.3) 0 0 5px"></a>
28
+ <a href="http://fabric5.fabricjs.com/kitchensink" target="_blank"><img src="https://github.com/kangax/fabric.js/raw/master/lib/screenshot.png" style="width:300px;box-shadow:rgba(0,0,0,0.3) 0 0 5px"></a>
25
29
 
26
30
  Using Fabric.js, you can create and populate objects on canvas; objects like simple geometrical shapes — rectangles, circles, ellipses, polygons, or more complex shapes consisting of hundreds or thousands of simple paths. You can then scale, move, and rotate these objects with the mouse; modify their properties — color, transparency, z-index, etc. You can also manipulate these objects altogether — grouping them with a simple mouse selection.
27
31
 
@@ -35,7 +39,7 @@ Fabric.js allows you to easily create simple shapes like rectangles, circles, tr
35
39
  ### Goals
36
40
 
37
41
  - Unit tested (1150+ tests at the moment, 79%+ coverage)
38
- - Modular (~60 small ["classes", modules, mixins](http://fabricjs.com/docs/))
42
+ - Modular (~60 small ["classes", modules, mixins](http://fabric5.fabricjs.com/docs/))
39
43
  - Cross-browser
40
44
  - [Fast](https://github.com/kangax/fabric.js/wiki/Focus-on-speed)
41
45
  - Encapsulated in one object
@@ -53,7 +57,7 @@ Fabric.js allows you to easily create simple shapes like rectangles, circles, tr
53
57
  - Edge (chromium based, all versions)
54
58
  - IE11 and Edge legacy, not supported. Fabric up to 5.0 is written with ES5 in mind, but no specific tests are run for those browsers.
55
59
 
56
- You can [run automated unit tests](http://fabricjs.com/test/unit/) right in the browser.
60
+ You can [run automated unit tests](http://fabric5.fabricjs.com/test/unit/) right in the browser.
57
61
 
58
62
  ### History
59
63
 
@@ -171,17 +175,17 @@ See testem docs for more info: https://github.com/testem/testem
171
175
 
172
176
  ### Demos
173
177
 
174
- - [Demos](http://fabricjs.com/demos/)
175
- - [Kitchensink demo](http://fabricjs.com/kitchensink)
176
- - [Benchmarks](http://fabricjs.com/benchmarks/)
178
+ - [Demos](http://fabric5.fabricjs.com/demos/)
179
+ - [Kitchensink demo](http://fabric5.fabricjs.com/kitchensink)
180
+ - [Benchmarks](http://fabric5.fabricjs.com/benchmarks/)
177
181
 
178
182
  [Who's using Fabric?](http://trends.builtwith.com/javascript/FabricJS)
179
183
 
180
184
  ### Documentation
181
185
 
182
- Documentation is always available at [http://fabricjs.com/docs/](http://fabricjs.com/docs/).
186
+ Documentation is always available at [http://fabric5./docs/](http://fabric5.fabricjs.com/docs/).
183
187
 
184
- Also see [official 4-part intro series](http://fabricjs.com/articles), [presentation from BK.js](http://www.slideshare.net/kangax/fabricjs-building-acanvaslibrarybk) and [presentation from Falsy Values](http://www.slideshare.net/kangax/fabric-falsy-values-8067834) for an overview of fabric.js, how it works, and its features.
188
+ Also see [official 4-part intro series](http://fabric5.fabricjs.com/articles), [presentation from BK.js](http://www.slideshare.net/kangax/fabricjs-building-acanvaslibrarybk) and [presentation from Falsy Values](http://www.slideshare.net/kangax/fabric-falsy-values-8067834) for an overview of fabric.js, how it works, and its features.
185
189
 
186
190
  ### Optional modules
187
191
 
package/dist/fabric.js CHANGED
@@ -15225,12 +15225,6 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati
15225
15225
  additionalHeight = height * 0.1;
15226
15226
  }
15227
15227
  }
15228
- if (this instanceof fabric.Text && this.path) {
15229
- shouldRedraw = true;
15230
- shouldResizeCanvas = true;
15231
- additionalWidth += this.getHeightOfLine(0) * this.zoomX;
15232
- additionalHeight += this.getHeightOfLine(0) * this.zoomY;
15233
- }
15234
15228
  if (shouldRedraw) {
15235
15229
  if (shouldResizeCanvas) {
15236
15230
  canvas.width = Math.ceil(width + additionalWidth);
@@ -26337,8 +26331,10 @@ fabric.Image.filters.BaseFilter.fromObject = function(object, callback) {
26337
26331
  this._splitText();
26338
26332
  this._clearCache();
26339
26333
  if (this.path) {
26340
- this.width = this.path.width;
26341
- this.height = this.path.height;
26334
+ // Add the space of a line around the path. This is an approximation
26335
+ var additionalWidth = this.getHeightOfLine(0) * 1.1;
26336
+ this.width = this.path.width + additionalWidth;
26337
+ this.height = this.path.height + additionalWidth;
26342
26338
  }
26343
26339
  else {
26344
26340
  this.width = this.calcTextWidth() || this.cursorWidth || this.MIN_TEXT_WIDTH;