@pixldocs/canvas-renderer 0.5.294 → 0.5.296

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.
@@ -14582,8 +14582,22 @@ const PageCanvas = forwardRef(
14582
14582
  const prevObjCaching = obj.objectCaching;
14583
14583
  obj.set({ width: bakedWidth, scaleX: 1, scaleY: 1, objectCaching: false });
14584
14584
  obj.initDimensions();
14585
- obj.setPositionByOrigin(preBakeCenter, "center", "center");
14586
14585
  obj.objectCaching = prevObjCaching;
14586
+ if (sx > 0 && sy > 0) {
14587
+ obj.set({ scaleX: 1 / sx, scaleY: 1 / sy });
14588
+ const asTx = Number(decomposed.translateX ?? 0);
14589
+ const asTy = Number(decomposed.translateY ?? 0);
14590
+ const localCx = (preBakeCenter.x - asTx) / sx;
14591
+ const localCy = (preBakeCenter.y - asTy) / sy;
14592
+ const localWidth = bakedWidth * (1 / sx);
14593
+ const localHeight = (obj.height ?? intrinsicHeight) * (1 / sy);
14594
+ obj.set({
14595
+ left: localCx - localWidth / 2,
14596
+ top: localCy - localHeight / 2
14597
+ });
14598
+ } else {
14599
+ obj.setPositionByOrigin(preBakeCenter, "center", "center");
14600
+ }
14587
14601
  obj.dirty = true;
14588
14602
  if (activeObj) activeObj.dirty = true;
14589
14603
  finalWidth = bakedWidth;
@@ -23825,9 +23839,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23825
23839
  }
23826
23840
  return svgString;
23827
23841
  }
23828
- const resolvedPackageVersion = "0.5.294";
23842
+ const resolvedPackageVersion = "0.5.296";
23829
23843
  const PACKAGE_VERSION = resolvedPackageVersion;
23830
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.294";
23844
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.296";
23831
23845
  const roundParityValue = (value) => {
23832
23846
  if (typeof value !== "number") return value;
23833
23847
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24641,7 +24655,7 @@ class PixldocsRenderer {
24641
24655
  await this.waitForCanvasScene(container, cloned, i);
24642
24656
  }
24643
24657
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24644
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-uoX8_JuH.js");
24658
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Lo1YQq71.js");
24645
24659
  const prepared = preparePagesForExport(
24646
24660
  cloned.pages,
24647
24661
  canvasWidth,
@@ -26961,7 +26975,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26961
26975
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26962
26976
  sanitizeSvgTreeForPdf(svgToDraw);
26963
26977
  try {
26964
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-uoX8_JuH.js");
26978
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Lo1YQq71.js");
26965
26979
  try {
26966
26980
  await logTextMeasurementDiagnostic(svgToDraw);
26967
26981
  } catch {
@@ -27361,4 +27375,4 @@ export {
27361
27375
  buildTeaserBlurFlatKeys as y,
27362
27376
  collectFontDescriptorsFromConfig as z
27363
27377
  };
27364
- //# sourceMappingURL=index-CvuMfLba.js.map
27378
+ //# sourceMappingURL=index-JckTC23Z.js.map