@pixldocs/canvas-renderer 0.5.30 → 0.5.31

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
@@ -2750,30 +2750,17 @@ const clearFontCacheAndRerender = (canvas) => {
2750
2750
  if (beforeMetrics.length > 0) {
2751
2751
  logUnderlineDebug("before-rerender", beforeMetrics);
2752
2752
  }
2753
- const resetTextboxLayoutInternals = (obj) => {
2754
- var _a;
2755
- (_a = obj._clearCache) == null ? void 0 : _a.call(obj);
2756
- obj.__charBounds = [];
2757
- obj.__lineWidths = [];
2758
- obj.__lineHeights = [];
2759
- obj.__graphemeLines = [];
2760
- obj._textLines = [];
2761
- obj.textLines = [];
2762
- obj._styleMap = null;
2763
- obj.styleMap = null;
2764
- obj.dirty = true;
2765
- };
2766
2753
  const fixTextbox = (obj) => {
2767
2754
  var _a, _b, _c;
2768
2755
  if (obj instanceof fabric.Textbox) {
2769
2756
  const savedWidth = obj.width;
2770
2757
  const savedScaleX = obj.scaleX;
2771
2758
  const savedScaleY = obj.scaleY;
2772
- resetTextboxLayoutInternals(obj);
2759
+ obj._forceClearCache = true;
2773
2760
  obj.initDimensions();
2774
2761
  if (savedWidth != null) {
2775
2762
  obj.set({ width: savedWidth, scaleX: savedScaleX, scaleY: savedScaleY });
2776
- resetTextboxLayoutInternals(obj);
2763
+ obj._forceClearCache = true;
2777
2764
  obj.initDimensions();
2778
2765
  obj.set({ width: savedWidth, scaleX: savedScaleX, scaleY: savedScaleY, dirty: true });
2779
2766
  }