fabric-vectr 6.7.3 → 6.7.4

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.
Files changed (43) hide show
  1. package/dist/index.js +46 -39
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.min.js +1 -1
  4. package/dist/index.min.js.map +1 -1
  5. package/dist/index.min.mjs +1 -1
  6. package/dist/index.min.mjs.map +1 -1
  7. package/dist/index.mjs +46 -39
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/index.node.cjs +46 -39
  10. package/dist/index.node.cjs.map +1 -1
  11. package/dist/index.node.mjs +46 -39
  12. package/dist/index.node.mjs.map +1 -1
  13. package/dist/package.json.min.mjs +1 -1
  14. package/dist/package.json.mjs +1 -1
  15. package/dist/src/shapes/Group.d.ts.map +1 -1
  16. package/dist/src/shapes/Group.min.mjs +1 -1
  17. package/dist/src/shapes/Group.min.mjs.map +1 -1
  18. package/dist/src/shapes/Group.mjs +1 -1
  19. package/dist/src/shapes/Group.mjs.map +1 -1
  20. package/dist/src/shapes/Object/InteractiveObject.d.ts +6 -0
  21. package/dist/src/shapes/Object/InteractiveObject.d.ts.map +1 -1
  22. package/dist/src/shapes/Object/InteractiveObject.min.mjs +1 -1
  23. package/dist/src/shapes/Object/InteractiveObject.min.mjs.map +1 -1
  24. package/dist/src/shapes/Object/InteractiveObject.mjs +41 -35
  25. package/dist/src/shapes/Object/InteractiveObject.mjs.map +1 -1
  26. package/dist/src/shapes/Text/Text.min.mjs +1 -1
  27. package/dist/src/shapes/Text/Text.min.mjs.map +1 -1
  28. package/dist/src/shapes/Text/Text.mjs +2 -2
  29. package/dist/src/shapes/Text/Text.mjs.map +1 -1
  30. package/dist/src/shapes/Textbox.d.ts.map +1 -1
  31. package/dist/src/shapes/Textbox.min.mjs +1 -1
  32. package/dist/src/shapes/Textbox.min.mjs.map +1 -1
  33. package/dist/src/shapes/Textbox.mjs +1 -0
  34. package/dist/src/shapes/Textbox.mjs.map +1 -1
  35. package/dist-extensions/src/shapes/Group.d.ts.map +1 -1
  36. package/dist-extensions/src/shapes/Object/InteractiveObject.d.ts +6 -0
  37. package/dist-extensions/src/shapes/Object/InteractiveObject.d.ts.map +1 -1
  38. package/dist-extensions/src/shapes/Textbox.d.ts.map +1 -1
  39. package/package.json +2 -2
  40. package/src/shapes/Group.ts +4 -1
  41. package/src/shapes/Object/InteractiveObject.ts +7 -0
  42. package/src/shapes/Text/Text.ts +2 -2
  43. package/src/shapes/Textbox.ts +1 -0
package/dist/index.js CHANGED
@@ -366,7 +366,7 @@
366
366
  }
367
367
  const cache = new Cache();
368
368
 
369
- var version = "6.7.3";
369
+ var version = "6.7.4";
370
370
 
371
371
  // use this syntax so babel plugin see this import here
372
372
  const VERSION = version;
@@ -9549,6 +9549,47 @@
9549
9549
  */
9550
9550
  constructor(options) {
9551
9551
  super();
9552
+ /**
9553
+ * The object's controls' position in viewport coordinates
9554
+ * Calculated by {@link Control#positionHandler} and {@link Control#calcCornerCoords}, depending on {@link padding}.
9555
+ * `corner/touchCorner` describe the 4 points forming the interactive area of the corner.
9556
+ * Used to draw and locate controls.
9557
+ */
9558
+ /**
9559
+ * keeps the value of the last hovered corner during mouse move.
9560
+ * 0 is no corner, or 'mt', 'ml', 'mtr' etc..
9561
+ * It should be private, but there is no harm in using it as
9562
+ * a read-only property.
9563
+ * this isn't cleaned automatically. Non selected objects may have wrong values
9564
+ * @type [string]
9565
+ */
9566
+ /**
9567
+ * a map of control visibility for this object.
9568
+ * this was left when controls were introduced to not break the api too much
9569
+ * this takes priority over the generic control visibility
9570
+ */
9571
+ /**
9572
+ * holds the controls for the object.
9573
+ * controls are added by default_controls.js
9574
+ */
9575
+ /**
9576
+ * internal boolean to signal the code that the object is
9577
+ * part of the move action.
9578
+ */
9579
+ /**
9580
+ * A boolean used from the gesture module to keep tracking of a scaling
9581
+ * action when there is no scaling transform in place.
9582
+ * This is an edge case and is used twice in all codebase.
9583
+ * Probably added to keep track of some performance issues
9584
+ * @TODO use git blame to investigate why it was added
9585
+ * DON'T USE IT. WE WILL TRY TO REMOVE IT
9586
+ */
9587
+ /**
9588
+ * When set to `true`, object's group should not cache
9589
+ * @type Boolean
9590
+ * @default false
9591
+ */
9592
+ _defineProperty(this, "preventGroupCache", void 0);
9552
9593
  Object.assign(this, this.constructor.createControls(), InteractiveFabricObject.ownDefaults);
9553
9594
  this.setOptions(options);
9554
9595
  }
@@ -10042,41 +10083,6 @@
10042
10083
  // for subclasses
10043
10084
  }
10044
10085
  }
10045
- /**
10046
- * The object's controls' position in viewport coordinates
10047
- * Calculated by {@link Control#positionHandler} and {@link Control#calcCornerCoords}, depending on {@link padding}.
10048
- * `corner/touchCorner` describe the 4 points forming the interactive area of the corner.
10049
- * Used to draw and locate controls.
10050
- */
10051
- /**
10052
- * keeps the value of the last hovered corner during mouse move.
10053
- * 0 is no corner, or 'mt', 'ml', 'mtr' etc..
10054
- * It should be private, but there is no harm in using it as
10055
- * a read-only property.
10056
- * this isn't cleaned automatically. Non selected objects may have wrong values
10057
- * @type [string]
10058
- */
10059
- /**
10060
- * a map of control visibility for this object.
10061
- * this was left when controls were introduced to not break the api too much
10062
- * this takes priority over the generic control visibility
10063
- */
10064
- /**
10065
- * holds the controls for the object.
10066
- * controls are added by default_controls.js
10067
- */
10068
- /**
10069
- * internal boolean to signal the code that the object is
10070
- * part of the move action.
10071
- */
10072
- /**
10073
- * A boolean used from the gesture module to keep tracking of a scaling
10074
- * action when there is no scaling transform in place.
10075
- * This is an edge case and is used twice in all codebase.
10076
- * Probably added to keep track of some performance issues
10077
- * @TODO use git blame to investigate why it was added
10078
- * DON'T USE IT. WE WILL TRY TO REMOVE IT
10079
- */
10080
10086
  _defineProperty(InteractiveFabricObject, "ownDefaults", interactiveObjectDefaultValues);
10081
10087
 
10082
10088
  /***
@@ -12074,7 +12080,7 @@
12074
12080
  const ownCache = FabricObject.prototype.shouldCache.call(this);
12075
12081
  if (ownCache) {
12076
12082
  for (let i = 0; i < this._objects.length; i++) {
12077
- if (this._objects[i].willDrawShadow()) {
12083
+ if (this._objects[i].willDrawShadow() || this._objects[i].preventGroupCache) {
12078
12084
  this.ownCaching = false;
12079
12085
  return false;
12080
12086
  }
@@ -19819,8 +19825,8 @@
19819
19825
  _getCacheCanvasDimensions() {
19820
19826
  const dims = super._getCacheCanvasDimensions();
19821
19827
  const fontSize = this.fontSize;
19822
- dims.width += fontSize * dims.zoomX;
19823
- dims.height += fontSize * dims.zoomY;
19828
+ dims.width += fontSize * dims.zoomX * 2;
19829
+ dims.height += fontSize * dims.zoomY * 2;
19824
19830
  return dims;
19825
19831
  }
19826
19832
 
@@ -23789,6 +23795,7 @@
23789
23795
  // clear cache and re-calculate height
23790
23796
  this.height = this.calcTextHeight();
23791
23797
  }
23798
+ this.preventGroupCache = this.path ? true : false;
23792
23799
  }
23793
23800
 
23794
23801
  /**