@pixldocs/canvas-renderer 0.5.421 → 0.5.422

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.
@@ -14354,7 +14354,7 @@ const PageCanvas = forwardRef(
14354
14354
  fabricCanvas.on("selection:cleared", () => {
14355
14355
  });
14356
14356
  fabricCanvas.on("object:scaling", (e) => {
14357
- var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
14357
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
14358
14358
  if (!isActiveRef.current) return;
14359
14359
  const t = e.target;
14360
14360
  if (t) lastResizeScaleTargetRef.current = t;
@@ -14645,14 +14645,19 @@ const PageCanvas = forwardRef(
14645
14645
  let didReflowTextChild = false;
14646
14646
  for (const child of obj.getObjects()) {
14647
14647
  if (child.__asLiveOrigAngle == null) {
14648
- const childId = getObjectId(child);
14649
- const sourceChild = childId ? elementsRef.current.find((el) => el.id === childId) : void 0;
14650
- const storedWorldAngle = Number.isFinite(sourceChild == null ? void 0 : sourceChild.angle) ? sourceChild.angle ?? 0 : void 0;
14651
- const logicalGroupId = obj.__pixldocsGroupSelection;
14652
- const groupWorldAngle = logicalGroupId ? ((_k = groupSelectionTransformStartRef.current) == null ? void 0 : _k.groupId) === logicalGroupId ? groupSelectionTransformStartRef.current.groupAngle : obj.__pixldocsFrozenGroupAngle ?? (obj.angle ?? 0) : 0;
14653
- child.__asLiveOrigAngle = storedWorldAngle !== void 0 ? storedWorldAngle - groupWorldAngle : child.angle ?? 0;
14648
+ const currentLocalAngle = Number.isFinite(child.angle) ? child.angle ?? 0 : void 0;
14649
+ let matrixLocalAngle;
14650
+ try {
14651
+ const selectionMatrix = obj.calcTransformMatrix();
14652
+ const childMatrix = child.calcOwnMatrix();
14653
+ const worldMatrix = fabric.util.multiplyTransformMatrices(selectionMatrix, childMatrix);
14654
+ const liveWorldAngle = fabric.util.qrDecompose(worldMatrix).angle ?? 0;
14655
+ matrixLocalAngle = liveWorldAngle - (obj.angle ?? 0);
14656
+ } catch {
14657
+ }
14658
+ child.__asLiveOrigAngle = currentLocalAngle ?? matrixLocalAngle ?? 0;
14654
14659
  }
14655
- if (child instanceof fabric.Group && (child.__cropGroup || ((_l = child._ct) == null ? void 0 : _l.isCropGroup))) {
14660
+ if (child instanceof fabric.Group && (child.__cropGroup || ((_k = child._ct) == null ? void 0 : _k.isCropGroup))) {
14656
14661
  const ct = child.__cropData;
14657
14662
  if (!ct) continue;
14658
14663
  if (child.__asLiveOrigAngle == null) {
@@ -14821,7 +14826,7 @@ const PageCanvas = forwardRef(
14821
14826
  child.dirty = true;
14822
14827
  didReflowTextChild = true;
14823
14828
  }
14824
- if (isXSide && ((_m = groupShiftReflowSnapshotRef.current) == null ? void 0 : _m.selection) === obj) {
14829
+ if (isXSide && ((_l = groupShiftReflowSnapshotRef.current) == null ? void 0 : _l.selection) === obj) {
14825
14830
  const snap = groupShiftReflowSnapshotRef.current;
14826
14831
  const anchorEntry = snap.children[0];
14827
14832
  const anchorTopLive = anchorEntry.obj.top ?? 0;
@@ -14982,7 +14987,7 @@ const PageCanvas = forwardRef(
14982
14987
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
14983
14988
  if (drilledGroupIdRef.current) {
14984
14989
  try {
14985
- (_n = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _n.call(fabricCanvas);
14990
+ (_m = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _m.call(fabricCanvas);
14986
14991
  } catch {
14987
14992
  }
14988
14993
  }
@@ -25559,9 +25564,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25559
25564
  }
25560
25565
  return svgString;
25561
25566
  }
25562
- const resolvedPackageVersion = "0.5.421";
25567
+ const resolvedPackageVersion = "0.5.422";
25563
25568
  const PACKAGE_VERSION = resolvedPackageVersion;
25564
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.421";
25569
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.422";
25565
25570
  const roundParityValue = (value) => {
25566
25571
  if (typeof value !== "number") return value;
25567
25572
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26375,7 +26380,7 @@ class PixldocsRenderer {
26375
26380
  await this.waitForCanvasScene(container, cloned, i);
26376
26381
  }
26377
26382
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26378
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BehYdYkb.js");
26383
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CnV1fqDs.js");
26379
26384
  const prepared = preparePagesForExport(
26380
26385
  cloned.pages,
26381
26386
  canvasWidth,
@@ -28695,7 +28700,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28695
28700
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28696
28701
  sanitizeSvgTreeForPdf(svgToDraw);
28697
28702
  try {
28698
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BehYdYkb.js");
28703
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CnV1fqDs.js");
28699
28704
  try {
28700
28705
  await logTextMeasurementDiagnostic(svgToDraw);
28701
28706
  } catch {
@@ -29095,4 +29100,4 @@ export {
29095
29100
  buildTeaserBlurFlatKeys as y,
29096
29101
  collectFontDescriptorsFromConfig as z
29097
29102
  };
29098
- //# sourceMappingURL=index-DTK00FP2.js.map
29103
+ //# sourceMappingURL=index-DFjuU6N6.js.map