@pixldocs/canvas-renderer 0.5.429 → 0.5.431

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,23 @@ 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
+ const active = fabricCanvas.getActiveObject();
16706
+ const isIndividuallySelected = active === target;
16707
+ if (!isIndividuallySelected) {
16708
+ try {
16709
+ fabricCanvas.discardActiveObject();
16710
+ fabricCanvas.setActiveObject(target);
16711
+ fabricCanvas.requestRenderAll();
16712
+ } catch {
16713
+ }
16714
+ return;
16715
+ }
16716
+ }
16684
16717
  if (innerImg && !isPlaceholder && !isCropGroupInCropMode(target)) {
16685
16718
  enterCropMode(target);
16686
16719
  return;
@@ -25707,9 +25740,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25707
25740
  }
25708
25741
  return svgString;
25709
25742
  }
25710
- const resolvedPackageVersion = "0.5.429";
25743
+ const resolvedPackageVersion = "0.5.431";
25711
25744
  const PACKAGE_VERSION = resolvedPackageVersion;
25712
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.429";
25745
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.431";
25713
25746
  const roundParityValue = (value) => {
25714
25747
  if (typeof value !== "number") return value;
25715
25748
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26523,7 +26556,7 @@ class PixldocsRenderer {
26523
26556
  await this.waitForCanvasScene(container, cloned, i);
26524
26557
  }
26525
26558
  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");
26559
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BbcJdy23.js");
26527
26560
  const prepared = preparePagesForExport(
26528
26561
  cloned.pages,
26529
26562
  canvasWidth,
@@ -28843,7 +28876,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28843
28876
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28844
28877
  sanitizeSvgTreeForPdf(svgToDraw);
28845
28878
  try {
28846
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DrAjSe3O.js");
28879
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BbcJdy23.js");
28847
28880
  try {
28848
28881
  await logTextMeasurementDiagnostic(svgToDraw);
28849
28882
  } catch {
@@ -29243,4 +29276,4 @@ export {
29243
29276
  buildTeaserBlurFlatKeys as y,
29244
29277
  collectFontDescriptorsFromConfig as z
29245
29278
  };
29246
- //# sourceMappingURL=index-bV8nKwDW.js.map
29279
+ //# sourceMappingURL=index-BKeBl1Ev.js.map