@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.cjs CHANGED
@@ -12775,53 +12775,7 @@ class PixldocsRenderer {
12775
12775
  };
12776
12776
  const reflowTextboxes = () => {
12777
12777
  var _a, _b, _c;
12778
- const walk = (obj) => {
12779
- var _a2, _b2, _c2, _d;
12780
- if (!obj) return;
12781
- const children = Array.isArray(obj._objects) ? obj._objects : Array.isArray(obj.objects) ? obj.objects : [];
12782
- if (children.length) children.forEach(walk);
12783
- const isTextObject = typeof obj.text === "string" && typeof obj.initDimensions === "function" && (obj.type === "textbox" || obj.type === "text" || obj.type === "i-text" || obj.isEditing !== void 0);
12784
- if (isTextObject) {
12785
- const saved = {
12786
- width: obj.width,
12787
- scaleX: obj.scaleX,
12788
- scaleY: obj.scaleY
12789
- };
12790
- const resetTextboxLayoutInternals = () => {
12791
- var _a3;
12792
- (_a3 = obj._clearCache) == null ? void 0 : _a3.call(obj);
12793
- obj.__charBounds = [];
12794
- obj.__lineWidths = [];
12795
- obj.__lineHeights = [];
12796
- obj.__graphemeLines = [];
12797
- obj._textLines = [];
12798
- obj.textLines = [];
12799
- obj._styleMap = null;
12800
- obj.styleMap = null;
12801
- obj.dirty = true;
12802
- };
12803
- resetTextboxLayoutInternals();
12804
- obj.initDimensions();
12805
- if (saved.width != null) {
12806
- (_a2 = obj.set) == null ? void 0 : _a2.call(obj, {
12807
- width: saved.width,
12808
- scaleX: saved.scaleX,
12809
- scaleY: saved.scaleY
12810
- });
12811
- resetTextboxLayoutInternals();
12812
- obj.initDimensions();
12813
- }
12814
- (_b2 = obj.set) == null ? void 0 : _b2.call(obj, {
12815
- width: saved.width,
12816
- scaleX: saved.scaleX,
12817
- scaleY: saved.scaleY,
12818
- dirty: true
12819
- });
12820
- (_c2 = obj._clearCache) == null ? void 0 : _c2.call(obj);
12821
- (_d = obj.setCoords) == null ? void 0 : _d.call(obj);
12822
- }
12823
- };
12824
- fabricInstance.getObjects().forEach(walk);
12778
+ clearFontCacheAndRerender(fabricInstance);
12825
12779
  (_a = fabricInstance.calcOffset) == null ? void 0 : _a.call(fabricInstance);
12826
12780
  (_b = fabricInstance.renderAll) == null ? void 0 : _b.call(fabricInstance);
12827
12781
  (_c = fabricInstance.requestRenderAll) == null ? void 0 : _c.call(fabricInstance);