@pixldocs/canvas-renderer 0.5.362 → 0.5.363

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.
@@ -15306,8 +15306,13 @@ const PageCanvas = forwardRef(
15306
15306
  } catch {
15307
15307
  }
15308
15308
  try {
15309
- absoluteLeft = (decomposed.translateX ?? absoluteLeft) - finalWidth / 2;
15310
- absoluteTop = (decomposed.translateY ?? absoluteTop) - finalHeight / 2;
15309
+ const textCenterX = decomposed.translateX ?? absoluteLeft;
15310
+ const textCenterY = decomposed.translateY ?? absoluteTop;
15311
+ const theta = fabric.util.degreesToRadians(decomposed.angle ?? 0);
15312
+ const cos = Math.cos(theta);
15313
+ const sin = Math.sin(theta);
15314
+ absoluteLeft = textCenterX - (cos * finalWidth / 2 - sin * finalHeight / 2);
15315
+ absoluteTop = textCenterY - (sin * finalWidth / 2 + cos * finalHeight / 2);
15311
15316
  } catch {
15312
15317
  }
15313
15318
  finalAbsoluteMatrix = fabric.util.composeMatrix({
@@ -24586,9 +24591,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24586
24591
  }
24587
24592
  return svgString;
24588
24593
  }
24589
- const resolvedPackageVersion = "0.5.362";
24594
+ const resolvedPackageVersion = "0.5.363";
24590
24595
  const PACKAGE_VERSION = resolvedPackageVersion;
24591
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.362";
24596
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.363";
24592
24597
  const roundParityValue = (value) => {
24593
24598
  if (typeof value !== "number") return value;
24594
24599
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25402,7 +25407,7 @@ class PixldocsRenderer {
25402
25407
  await this.waitForCanvasScene(container, cloned, i);
25403
25408
  }
25404
25409
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25405
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BVELqTIO.js");
25410
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DtI5z_ZO.js");
25406
25411
  const prepared = preparePagesForExport(
25407
25412
  cloned.pages,
25408
25413
  canvasWidth,
@@ -27722,7 +27727,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27722
27727
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27723
27728
  sanitizeSvgTreeForPdf(svgToDraw);
27724
27729
  try {
27725
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BVELqTIO.js");
27730
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DtI5z_ZO.js");
27726
27731
  try {
27727
27732
  await logTextMeasurementDiagnostic(svgToDraw);
27728
27733
  } catch {
@@ -28122,4 +28127,4 @@ export {
28122
28127
  buildTeaserBlurFlatKeys as y,
28123
28128
  collectFontDescriptorsFromConfig as z
28124
28129
  };
28125
- //# sourceMappingURL=index-WH1l4oST.js.map
28130
+ //# sourceMappingURL=index-Cw161PRH.js.map