@pixldocs/canvas-renderer 0.5.429 → 0.5.430

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.
@@ -5021,7 +5021,13 @@ function updateCoverLayout(g) {
5021
5021
  scaleX: finalScale,
5022
5022
  scaleY: finalScale,
5023
5023
  originX: "center",
5024
- originY: "center"
5024
+ originY: "center",
5025
+ // Always keep inner bitmap axis-aligned within the frame; the parent
5026
+ // crop group owns the rotation. See createMaskedImageElement for the
5027
+ // full rationale.
5028
+ angle: 0,
5029
+ skewX: 0,
5030
+ skewY: 0
5025
5031
  });
5026
5032
  const dispW = iw * finalScale;
5027
5033
  const dispH = ih * finalScale;
@@ -5457,6 +5463,16 @@ async function createMaskedImageElement({
5457
5463
  evented: false,
5458
5464
  opacity: 1,
5459
5465
  // CRITICAL: Always 1 for child - group handles opacity
5466
+ // Force the inner bitmap's angle to 0 so it inherits ONLY the parent
5467
+ // crop group's rotation. Some image sources (e.g. previously-rotated
5468
+ // FabricImage objects, EXIF-baked PNGs, or drop-replacement payloads
5469
+ // that carried a stale `angle` from a logical group) arrive here with
5470
+ // a non-zero local angle. Without this reset the bitmap renders at
5471
+ // (groupAngle + imgAngle) after reload, while the frame only carries
5472
+ // groupAngle — making the photo look mis-rotated inside its frame.
5473
+ angle: 0,
5474
+ skewX: 0,
5475
+ skewY: 0,
5460
5476
  // Preserve image-level caching settings if they exist
5461
5477
  objectCaching: img.objectCaching ?? false,
5462
5478
  noScaleCache: img.noScaleCache ?? true
@@ -16669,7 +16685,7 @@ const PageCanvas = forwardRef(
16669
16685
  }
16670
16686
  });
16671
16687
  fabricCanvas.on("mouse:dblclick", (e) => {
16672
- var _a2, _b2;
16688
+ var _a2, _b2, _c2;
16673
16689
  if (!isActiveRef.current || !allowEditing) return;
16674
16690
  let target = e.target;
16675
16691
  if (!target) {
@@ -16681,6 +16697,16 @@ const PageCanvas = forwardRef(
16681
16697
  const innerImg = ct == null ? void 0 : ct._img;
16682
16698
  const innerSrc = ((_a2 = innerImg == null ? void 0 : innerImg.getSrc) == null ? void 0 : _a2.call(innerImg)) || ((_b2 = innerImg == null ? void 0 : innerImg._originalElement) == null ? void 0 : _b2.src) || (innerImg == null ? void 0 : innerImg.src) || "";
16683
16699
  const isPlaceholder = !innerSrc || innerSrc === EMPTY_IMAGE_PLACEHOLDER_DATA_URL;
16700
+ const targetId = getObjectId(target);
16701
+ const pageChildrenForCrop = ((_c2 = useEditorStore.getState().canvas.pages.find((p) => p.id === pageId)) == null ? void 0 : _c2.children) ?? [];
16702
+ const parentForCrop = targetId ? findParentGroup(pageChildrenForCrop, targetId) : null;
16703
+ const isInsideGroup = !!parentForCrop;
16704
+ if (isInsideGroup) {
16705
+ toast.info("Ungroup to crop this image", {
16706
+ description: "Crop mode is disabled for images inside a group. Select the group and ungroup first."
16707
+ });
16708
+ return;
16709
+ }
16684
16710
  if (innerImg && !isPlaceholder && !isCropGroupInCropMode(target)) {
16685
16711
  enterCropMode(target);
16686
16712
  return;
@@ -25707,9 +25733,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25707
25733
  }
25708
25734
  return svgString;
25709
25735
  }
25710
- const resolvedPackageVersion = "0.5.429";
25736
+ const resolvedPackageVersion = "0.5.430";
25711
25737
  const PACKAGE_VERSION = resolvedPackageVersion;
25712
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.429";
25738
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.430";
25713
25739
  const roundParityValue = (value) => {
25714
25740
  if (typeof value !== "number") return value;
25715
25741
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26523,7 +26549,7 @@ class PixldocsRenderer {
26523
26549
  await this.waitForCanvasScene(container, cloned, i);
26524
26550
  }
26525
26551
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26526
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DrAjSe3O.js");
26552
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DIqgjv2w.js");
26527
26553
  const prepared = preparePagesForExport(
26528
26554
  cloned.pages,
26529
26555
  canvasWidth,
@@ -28843,7 +28869,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28843
28869
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28844
28870
  sanitizeSvgTreeForPdf(svgToDraw);
28845
28871
  try {
28846
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DrAjSe3O.js");
28872
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DIqgjv2w.js");
28847
28873
  try {
28848
28874
  await logTextMeasurementDiagnostic(svgToDraw);
28849
28875
  } catch {
@@ -29243,4 +29269,4 @@ export {
29243
29269
  buildTeaserBlurFlatKeys as y,
29244
29270
  collectFontDescriptorsFromConfig as z
29245
29271
  };
29246
- //# sourceMappingURL=index-bV8nKwDW.js.map
29272
+ //# sourceMappingURL=index-Bae6ojJH.js.map