@pixldocs/canvas-renderer 0.5.419 → 0.5.421

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.
@@ -14372,7 +14372,7 @@ const PageCanvas = react.forwardRef(
14372
14372
  fabricCanvas.on("selection:cleared", () => {
14373
14373
  });
14374
14374
  fabricCanvas.on("object:scaling", (e) => {
14375
- var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
14375
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
14376
14376
  if (!isActiveRef.current) return;
14377
14377
  const t = e.target;
14378
14378
  if (t) lastResizeScaleTargetRef.current = t;
@@ -14665,9 +14665,12 @@ const PageCanvas = react.forwardRef(
14665
14665
  if (child.__asLiveOrigAngle == null) {
14666
14666
  const childId = getObjectId(child);
14667
14667
  const sourceChild = childId ? elementsRef.current.find((el) => el.id === childId) : void 0;
14668
- child.__asLiveOrigAngle = Number.isFinite(sourceChild == null ? void 0 : sourceChild.angle) ? sourceChild.angle ?? 0 : child.angle ?? 0;
14668
+ const storedWorldAngle = Number.isFinite(sourceChild == null ? void 0 : sourceChild.angle) ? sourceChild.angle ?? 0 : void 0;
14669
+ const logicalGroupId = obj.__pixldocsGroupSelection;
14670
+ const groupWorldAngle = logicalGroupId ? ((_k = groupSelectionTransformStartRef.current) == null ? void 0 : _k.groupId) === logicalGroupId ? groupSelectionTransformStartRef.current.groupAngle : obj.__pixldocsFrozenGroupAngle ?? (obj.angle ?? 0) : 0;
14671
+ child.__asLiveOrigAngle = storedWorldAngle !== void 0 ? storedWorldAngle - groupWorldAngle : child.angle ?? 0;
14669
14672
  }
14670
- if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_k = child._ct) == null ? void 0 : _k.isCropGroup))) {
14673
+ if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_l = child._ct) == null ? void 0 : _l.isCropGroup))) {
14671
14674
  const ct = child.__cropData;
14672
14675
  if (!ct) continue;
14673
14676
  if (child.__asLiveOrigAngle == null) {
@@ -14836,7 +14839,7 @@ const PageCanvas = react.forwardRef(
14836
14839
  child.dirty = true;
14837
14840
  didReflowTextChild = true;
14838
14841
  }
14839
- if (isXSide && ((_l = groupShiftReflowSnapshotRef.current) == null ? void 0 : _l.selection) === obj) {
14842
+ if (isXSide && ((_m = groupShiftReflowSnapshotRef.current) == null ? void 0 : _m.selection) === obj) {
14840
14843
  const snap = groupShiftReflowSnapshotRef.current;
14841
14844
  const anchorEntry = snap.children[0];
14842
14845
  const anchorTopLive = anchorEntry.obj.top ?? 0;
@@ -14997,7 +15000,7 @@ const PageCanvas = react.forwardRef(
14997
15000
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
14998
15001
  if (drilledGroupIdRef.current) {
14999
15002
  try {
15000
- (_m = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _m.call(fabricCanvas);
15003
+ (_n = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _n.call(fabricCanvas);
15001
15004
  } catch {
15002
15005
  }
15003
15006
  }
@@ -15927,7 +15930,16 @@ const PageCanvas = react.forwardRef(
15927
15930
  scaleX: 1,
15928
15931
  scaleY: 1,
15929
15932
  skewX: 0,
15930
- skewY: 0
15933
+ skewY: 0,
15934
+ // CRITICAL: restore the child's ORIGINAL local angle (pre-live-preview).
15935
+ // The live preview path mutates obj.angle via qrDecompose(S^-1·R(θ))
15936
+ // to cancel AS shear visually. If we leave that mutated angle on the
15937
+ // object, fabric's AS-discard step bakes (AS.angle + mutatedAngle)
15938
+ // into the standalone image — so the next individual rotation starts
15939
+ // from a wrong base and visibly "snaps back" to the pre-resize angle.
15940
+ // Restoring the original local angle here makes AS-discard bake the
15941
+ // correct world angle (AS.angle + imgChildLocalAngle === worldAngleI).
15942
+ angle: imgChildLocalAngle
15931
15943
  });
15932
15944
  obj.dirty = true;
15933
15945
  obj.setCoords();
@@ -25565,9 +25577,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25565
25577
  }
25566
25578
  return svgString;
25567
25579
  }
25568
- const resolvedPackageVersion = "0.5.419";
25580
+ const resolvedPackageVersion = "0.5.421";
25569
25581
  const PACKAGE_VERSION = resolvedPackageVersion;
25570
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.419";
25582
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.421";
25571
25583
  const roundParityValue = (value) => {
25572
25584
  if (typeof value !== "number") return value;
25573
25585
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26381,7 +26393,7 @@ class PixldocsRenderer {
26381
26393
  await this.waitForCanvasScene(container, cloned, i);
26382
26394
  }
26383
26395
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26384
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-ftEgzh_b.cjs"));
26396
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CVTsNdX0.cjs"));
26385
26397
  const prepared = preparePagesForExport(
26386
26398
  cloned.pages,
26387
26399
  canvasWidth,
@@ -28701,7 +28713,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28701
28713
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28702
28714
  sanitizeSvgTreeForPdf(svgToDraw);
28703
28715
  try {
28704
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-ftEgzh_b.cjs"));
28716
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CVTsNdX0.cjs"));
28705
28717
  try {
28706
28718
  await logTextMeasurementDiagnostic(svgToDraw);
28707
28719
  } catch {
@@ -29098,4 +29110,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
29098
29110
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
29099
29111
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
29100
29112
  exports.warmTemplateFromForm = warmTemplateFromForm;
29101
- //# sourceMappingURL=index-7_yV-1gx.cjs.map
29113
+ //# sourceMappingURL=index-CHFRo3xN.cjs.map