@pixldocs/canvas-renderer 0.3.22 → 0.3.23

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
@@ -11092,10 +11092,19 @@ class PixldocsRenderer {
11092
11092
  }
11093
11093
  const prevVPT = fabricInstance.viewportTransform ? [...fabricInstance.viewportTransform] : void 0;
11094
11094
  const prevSvgVPT = fabricInstance.svgViewportTransformation;
11095
+ const prevCanvasWidth = fabricInstance.width;
11096
+ const prevCanvasHeight = fabricInstance.height;
11097
+ fabricInstance.setDimensions(
11098
+ { width: canvasWidth, height: canvasHeight },
11099
+ { cssOnly: false, backstoreOnly: false }
11100
+ );
11095
11101
  fabricInstance.viewportTransform = [1, 0, 0, 1, 0, 0];
11096
11102
  fabricInstance.svgViewportTransformation = false;
11097
- let svgString = fabricInstance.toSVG();
11098
- svgString = this.normalizeSvgDimensions(svgString, canvasWidth, canvasHeight);
11103
+ const svgString = fabricInstance.toSVG();
11104
+ fabricInstance.setDimensions(
11105
+ { width: prevCanvasWidth, height: prevCanvasHeight },
11106
+ { cssOnly: false, backstoreOnly: false }
11107
+ );
11099
11108
  if (prevVPT) fabricInstance.viewportTransform = prevVPT;
11100
11109
  fabricInstance.svgViewportTransformation = prevSvgVPT;
11101
11110
  const page = config.pages[pageIndex];