@pixldocs/canvas-renderer 0.5.403 → 0.5.405

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.
@@ -14187,7 +14187,7 @@ const PageCanvas = react.forwardRef(
14187
14187
  fabricCanvas.on("selection:cleared", () => {
14188
14188
  });
14189
14189
  fabricCanvas.on("object:scaling", (e) => {
14190
- var _a2, _b2, _c2, _d, _e, _f, _g, _h;
14190
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j;
14191
14191
  if (!isActiveRef.current) return;
14192
14192
  const t = e.target;
14193
14193
  if (t) lastResizeScaleTargetRef.current = t;
@@ -14371,15 +14371,18 @@ const PageCanvas = react.forwardRef(
14371
14371
  }
14372
14372
  if (obj instanceof fabric__namespace.ActiveSelection && (corner === "ml" || corner === "mr" || corner === "mt" || corner === "mb")) {
14373
14373
  const isXSide = corner === "ml" || corner === "mr";
14374
- const sAxis = isXSide ? Math.abs(obj.scaleX ?? 1) : Math.abs(obj.scaleY ?? 1);
14374
+ const _cur = fabricCanvas._currentTransform;
14375
+ const startSx = Math.abs(Number(((_d = _cur == null ? void 0 : _cur.original) == null ? void 0 : _d.scaleX) ?? 1)) || 1;
14376
+ const startSy = Math.abs(Number(((_e = _cur == null ? void 0 : _cur.original) == null ? void 0 : _e.scaleY) ?? 1)) || 1;
14377
+ const sAxis = isXSide ? Math.abs((obj.scaleX ?? 1) / startSx) : Math.abs((obj.scaleY ?? 1) / startSy);
14375
14378
  if (sAxis > 1e-3) {
14376
- if (isXSide && ((_d = groupShiftReflowSnapshotRef.current) == null ? void 0 : _d.selection) !== obj) {
14379
+ if (isXSide && ((_f = groupShiftReflowSnapshotRef.current) == null ? void 0 : _f.selection) !== obj) {
14377
14380
  groupShiftReflowSnapshotRef.current = null;
14378
14381
  const logicalGroupId = obj.__pixldocsGroupSelection;
14379
14382
  if (logicalGroupId) {
14380
14383
  try {
14381
14384
  const state = useEditorStore.getState();
14382
- const pageChildren2 = ((_e = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _e.children) ?? [];
14385
+ const pageChildren2 = ((_g = state.canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _g.children) ?? [];
14383
14386
  const groupNode = findNodeById(pageChildren2, logicalGroupId);
14384
14387
  if (groupNode && isGroup(groupNode) && !isStackLayoutMode(groupNode.layoutMode)) {
14385
14388
  const entries = obj.getObjects().map((c) => ({
@@ -14409,7 +14412,15 @@ const PageCanvas = react.forwardRef(
14409
14412
  const asRect0 = obj.getBoundingRect();
14410
14413
  let didReflowTextChild = false;
14411
14414
  for (const child of obj.getObjects()) {
14412
- if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_f = child._ct) == null ? void 0 : _f.isCropGroup))) {
14415
+ const childLocalAngle = child.__asLiveOrigAngle != null ? child.__asLiveOrigAngle : child.angle ?? 0;
14416
+ const isRotatedChild = Math.abs((childLocalAngle % 360 + 360) % 360) > 0.5 && Math.abs((childLocalAngle % 360 + 360) % 360 - 360) > 0.5;
14417
+ if (isRotatedChild) {
14418
+ if (child.__asLiveOrigAngle == null) {
14419
+ child.__asLiveOrigAngle = child.angle ?? 0;
14420
+ }
14421
+ continue;
14422
+ }
14423
+ if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_h = child._ct) == null ? void 0 : _h.isCropGroup))) {
14413
14424
  const ct = child.__cropData;
14414
14425
  if (!ct) continue;
14415
14426
  if (child.__asLiveOrigAngle == null) {
@@ -14576,7 +14587,7 @@ const PageCanvas = react.forwardRef(
14576
14587
  child.dirty = true;
14577
14588
  didReflowTextChild = true;
14578
14589
  }
14579
- if (isXSide && ((_g = groupShiftReflowSnapshotRef.current) == null ? void 0 : _g.selection) === obj) {
14590
+ if (isXSide && ((_i = groupShiftReflowSnapshotRef.current) == null ? void 0 : _i.selection) === obj) {
14580
14591
  const snap = groupShiftReflowSnapshotRef.current;
14581
14592
  const anchorEntry = snap.children[0];
14582
14593
  const anchorTopLive = anchorEntry.obj.top ?? 0;
@@ -14736,7 +14747,7 @@ const PageCanvas = react.forwardRef(
14736
14747
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
14737
14748
  if (drilledGroupIdRef.current) {
14738
14749
  try {
14739
- (_h = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _h.call(fabricCanvas);
14750
+ (_j = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _j.call(fabricCanvas);
14740
14751
  } catch {
14741
14752
  }
14742
14753
  }
@@ -25145,9 +25156,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25145
25156
  }
25146
25157
  return svgString;
25147
25158
  }
25148
- const resolvedPackageVersion = "0.5.403";
25159
+ const resolvedPackageVersion = "0.5.405";
25149
25160
  const PACKAGE_VERSION = resolvedPackageVersion;
25150
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.403";
25161
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.405";
25151
25162
  const roundParityValue = (value) => {
25152
25163
  if (typeof value !== "number") return value;
25153
25164
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25961,7 +25972,7 @@ class PixldocsRenderer {
25961
25972
  await this.waitForCanvasScene(container, cloned, i);
25962
25973
  }
25963
25974
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25964
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BevFDNWQ.cjs"));
25975
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DSku6Anm.cjs"));
25965
25976
  const prepared = preparePagesForExport(
25966
25977
  cloned.pages,
25967
25978
  canvasWidth,
@@ -28281,7 +28292,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28281
28292
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28282
28293
  sanitizeSvgTreeForPdf(svgToDraw);
28283
28294
  try {
28284
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BevFDNWQ.cjs"));
28295
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DSku6Anm.cjs"));
28285
28296
  try {
28286
28297
  await logTextMeasurementDiagnostic(svgToDraw);
28287
28298
  } catch {
@@ -28678,4 +28689,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
28678
28689
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
28679
28690
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
28680
28691
  exports.warmTemplateFromForm = warmTemplateFromForm;
28681
- //# sourceMappingURL=index-Bp9XxxF8.cjs.map
28692
+ //# sourceMappingURL=index-uJf5RraI.cjs.map