@pixldocs/canvas-renderer 0.5.413 → 0.5.415

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.
@@ -14628,13 +14628,8 @@ const PageCanvas = forwardRef(
14628
14628
  const asRect0 = obj.getBoundingRect();
14629
14629
  let didReflowTextChild = false;
14630
14630
  for (const child of obj.getObjects()) {
14631
- const childLocalAngle = child.__asLiveOrigAngle != null ? child.__asLiveOrigAngle : child.angle ?? 0;
14632
- const isRotatedChild = Math.abs((childLocalAngle % 360 + 360) % 360) > 0.5 && Math.abs((childLocalAngle % 360 + 360) % 360 - 360) > 0.5;
14633
- if (isRotatedChild) {
14634
- if (child.__asLiveOrigAngle == null) {
14635
- child.__asLiveOrigAngle = child.angle ?? 0;
14636
- }
14637
- continue;
14631
+ if (child.__asLiveOrigAngle == null) {
14632
+ child.__asLiveOrigAngle = child.angle ?? 0;
14638
14633
  }
14639
14634
  if (child instanceof fabric.Group && (child.__cropGroup || ((_k = child._ct) == null ? void 0 : _k.isCropGroup))) {
14640
14635
  const ct = child.__cropData;
@@ -16256,13 +16251,15 @@ const PageCanvas = forwardRef(
16256
16251
  if (isRotatedImg && activeObj instanceof fabric.ActiveSelection) {
16257
16252
  try {
16258
16253
  const cleanAngleI = childLocalAngleSrc;
16259
- const worldAngleI = (activeObj.angle ?? 0) + childLocalAngleSrc;
16260
16254
  const cleanW = Math.max(1, Number(elementUpdate.width ?? finalWidth));
16261
16255
  const cleanH = Math.max(1, Number(elementUpdate.height ?? finalHeight));
16262
16256
  const cx = decomposed.translateX ?? absoluteLeft + cleanW / 2;
16263
16257
  const cy = decomposed.translateY ?? absoluteTop + cleanH / 2;
16264
- const cleanAbsLeft = cx - cleanW / 2;
16265
- const cleanAbsTop = cy - cleanH / 2;
16258
+ const thetaI = fabric.util.degreesToRadians(cleanAngleI);
16259
+ const cosI = Math.cos(thetaI);
16260
+ const sinI = Math.sin(thetaI);
16261
+ const cleanAbsLeft = cx - (cosI * cleanW / 2 - sinI * cleanH / 2);
16262
+ const cleanAbsTop = cy - (sinI * cleanW / 2 + cosI * cleanH / 2);
16266
16263
  const cleanStorePos = absoluteToStorePosition(cleanAbsLeft, cleanAbsTop, objId, pageChildrenForSave);
16267
16264
  elementUpdate.left = cleanStorePos.left;
16268
16265
  elementUpdate.top = cleanStorePos.top;
@@ -16276,7 +16273,7 @@ const PageCanvas = forwardRef(
16276
16273
  elementUpdate.transformMatrix = fabric.util.composeMatrix({
16277
16274
  translateX: cx,
16278
16275
  translateY: cy,
16279
- angle: worldAngleI,
16276
+ angle: cleanAngleI,
16280
16277
  scaleX: 1,
16281
16278
  scaleY: 1,
16282
16279
  skewX: 0,
@@ -25522,9 +25519,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25522
25519
  }
25523
25520
  return svgString;
25524
25521
  }
25525
- const resolvedPackageVersion = "0.5.413";
25522
+ const resolvedPackageVersion = "0.5.415";
25526
25523
  const PACKAGE_VERSION = resolvedPackageVersion;
25527
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.413";
25524
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.415";
25528
25525
  const roundParityValue = (value) => {
25529
25526
  if (typeof value !== "number") return value;
25530
25527
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26338,7 +26335,7 @@ class PixldocsRenderer {
26338
26335
  await this.waitForCanvasScene(container, cloned, i);
26339
26336
  }
26340
26337
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26341
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-dyKsZkp-.js");
26338
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Db2vIeqx.js");
26342
26339
  const prepared = preparePagesForExport(
26343
26340
  cloned.pages,
26344
26341
  canvasWidth,
@@ -28658,7 +28655,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28658
28655
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28659
28656
  sanitizeSvgTreeForPdf(svgToDraw);
28660
28657
  try {
28661
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-dyKsZkp-.js");
28658
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Db2vIeqx.js");
28662
28659
  try {
28663
28660
  await logTextMeasurementDiagnostic(svgToDraw);
28664
28661
  } catch {
@@ -29058,4 +29055,4 @@ export {
29058
29055
  buildTeaserBlurFlatKeys as y,
29059
29056
  collectFontDescriptorsFromConfig as z
29060
29057
  };
29061
- //# sourceMappingURL=index-BTyRFQIc.js.map
29058
+ //# sourceMappingURL=index-B2-9Hojr.js.map