@pixldocs/canvas-renderer 0.5.31 → 0.5.32

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/dist/index.js CHANGED
@@ -12756,53 +12756,7 @@ class PixldocsRenderer {
12756
12756
  };
12757
12757
  const reflowTextboxes = () => {
12758
12758
  var _a, _b, _c;
12759
- const walk = (obj) => {
12760
- var _a2, _b2, _c2, _d;
12761
- if (!obj) return;
12762
- const children = Array.isArray(obj._objects) ? obj._objects : Array.isArray(obj.objects) ? obj.objects : [];
12763
- if (children.length) children.forEach(walk);
12764
- const isTextObject = typeof obj.text === "string" && typeof obj.initDimensions === "function" && (obj.type === "textbox" || obj.type === "text" || obj.type === "i-text" || obj.isEditing !== void 0);
12765
- if (isTextObject) {
12766
- const saved = {
12767
- width: obj.width,
12768
- scaleX: obj.scaleX,
12769
- scaleY: obj.scaleY
12770
- };
12771
- const resetTextboxLayoutInternals = () => {
12772
- var _a3;
12773
- (_a3 = obj._clearCache) == null ? void 0 : _a3.call(obj);
12774
- obj.__charBounds = [];
12775
- obj.__lineWidths = [];
12776
- obj.__lineHeights = [];
12777
- obj.__graphemeLines = [];
12778
- obj._textLines = [];
12779
- obj.textLines = [];
12780
- obj._styleMap = null;
12781
- obj.styleMap = null;
12782
- obj.dirty = true;
12783
- };
12784
- resetTextboxLayoutInternals();
12785
- obj.initDimensions();
12786
- if (saved.width != null) {
12787
- (_a2 = obj.set) == null ? void 0 : _a2.call(obj, {
12788
- width: saved.width,
12789
- scaleX: saved.scaleX,
12790
- scaleY: saved.scaleY
12791
- });
12792
- resetTextboxLayoutInternals();
12793
- obj.initDimensions();
12794
- }
12795
- (_b2 = obj.set) == null ? void 0 : _b2.call(obj, {
12796
- width: saved.width,
12797
- scaleX: saved.scaleX,
12798
- scaleY: saved.scaleY,
12799
- dirty: true
12800
- });
12801
- (_c2 = obj._clearCache) == null ? void 0 : _c2.call(obj);
12802
- (_d = obj.setCoords) == null ? void 0 : _d.call(obj);
12803
- }
12804
- };
12805
- fabricInstance.getObjects().forEach(walk);
12759
+ clearFontCacheAndRerender(fabricInstance);
12806
12760
  (_a = fabricInstance.calcOffset) == null ? void 0 : _a.call(fabricInstance);
12807
12761
  (_b = fabricInstance.renderAll) == null ? void 0 : _b.call(fabricInstance);
12808
12762
  (_c = fabricInstance.requestRenderAll) == null ? void 0 : _c.call(fabricInstance);