@pixldocs/canvas-renderer 0.5.299 → 0.5.300

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.
@@ -13414,7 +13414,7 @@ const PageCanvas = forwardRef(
13414
13414
  fabricCanvas.on("selection:cleared", () => {
13415
13415
  });
13416
13416
  fabricCanvas.on("object:scaling", (e) => {
13417
- var _a2, _b2;
13417
+ var _a2, _b2, _c;
13418
13418
  if (!isActiveRef.current) return;
13419
13419
  const t = e.target;
13420
13420
  if (t) lastResizeScaleTargetRef.current = t;
@@ -13600,6 +13600,48 @@ const PageCanvas = forwardRef(
13600
13600
  const asRect0 = obj.getBoundingRect();
13601
13601
  let didReflowTextChild = false;
13602
13602
  for (const child of obj.getObjects()) {
13603
+ if (child instanceof fabric.Group && (child.__cropGroup || ((_b2 = child._ct) == null ? void 0 : _b2.isCropGroup))) {
13604
+ const ct = child.__cropData;
13605
+ if (!ct) continue;
13606
+ if (isXSide) {
13607
+ if (child.__asLiveOrigW == null) {
13608
+ const baseW = child.width ?? ct.frameW ?? 0;
13609
+ child.__asLiveOrigW = baseW * (child.scaleX ?? 1);
13610
+ }
13611
+ const origW = child.__asLiveOrigW;
13612
+ const newW = Math.max(20, origW * sAxis);
13613
+ if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13614
+ ct.frameW = newW;
13615
+ child._set("width", newW);
13616
+ child._set("scaleX", 1 / sAxis);
13617
+ try {
13618
+ updateCoverLayout(child);
13619
+ } catch {
13620
+ }
13621
+ child.setCoords();
13622
+ child.dirty = true;
13623
+ }
13624
+ } else {
13625
+ if (child.__asLiveOrigH == null) {
13626
+ const baseH = child.height ?? ct.frameH ?? 0;
13627
+ child.__asLiveOrigH = baseH * (child.scaleY ?? 1);
13628
+ }
13629
+ const origH = child.__asLiveOrigH;
13630
+ const newH = Math.max(20, origH * sAxis);
13631
+ if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13632
+ ct.frameH = newH;
13633
+ child._set("height", newH);
13634
+ child._set("scaleY", 1 / sAxis);
13635
+ try {
13636
+ updateCoverLayout(child);
13637
+ } catch {
13638
+ }
13639
+ child.setCoords();
13640
+ child.dirty = true;
13641
+ }
13642
+ }
13643
+ continue;
13644
+ }
13603
13645
  if (child instanceof fabric.FabricImage && !child.__cropGroup && !child.smartElementType) {
13604
13646
  if (isXSide) {
13605
13647
  if (child.__asLiveOrigW == null) {
@@ -13776,7 +13818,7 @@ const PageCanvas = forwardRef(
13776
13818
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
13777
13819
  if (drilledGroupIdRef.current) {
13778
13820
  try {
13779
- (_b2 = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _b2.call(fabricCanvas);
13821
+ (_c = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _c.call(fabricCanvas);
13780
13822
  } catch {
13781
13823
  }
13782
13824
  }
@@ -14507,8 +14549,8 @@ const PageCanvas = forwardRef(
14507
14549
  if (ct) {
14508
14550
  const sourceFrameW = Math.max(1, ct.frameW ?? obj.width ?? 1);
14509
14551
  const sourceFrameH = Math.max(1, ct.frameH ?? obj.height ?? 1);
14510
- const appliedScaleX = Math.abs(isActiveSelection && activeObj ? activeObj.scaleX ?? 1 : obj.scaleX ?? 1);
14511
- const appliedScaleY = Math.abs(isActiveSelection && activeObj ? activeObj.scaleY ?? 1 : obj.scaleY ?? 1);
14552
+ const appliedScaleX = isActiveSelection && activeObj ? Math.abs((activeObj.scaleX ?? 1) * (obj.scaleX ?? 1)) : Math.abs(obj.scaleX ?? 1);
14553
+ const appliedScaleY = isActiveSelection && activeObj ? Math.abs((activeObj.scaleY ?? 1) * (obj.scaleY ?? 1)) : Math.abs(obj.scaleY ?? 1);
14512
14554
  finalWidth = Math.max(1, sourceFrameW * appliedScaleX);
14513
14555
  finalHeight = Math.max(1, sourceFrameH * appliedScaleY);
14514
14556
  finalScaleX = 1;
@@ -23955,9 +23997,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23955
23997
  }
23956
23998
  return svgString;
23957
23999
  }
23958
- const resolvedPackageVersion = "0.5.299";
24000
+ const resolvedPackageVersion = "0.5.300";
23959
24001
  const PACKAGE_VERSION = resolvedPackageVersion;
23960
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.299";
24002
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.300";
23961
24003
  const roundParityValue = (value) => {
23962
24004
  if (typeof value !== "number") return value;
23963
24005
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24771,7 +24813,7 @@ class PixldocsRenderer {
24771
24813
  await this.waitForCanvasScene(container, cloned, i);
24772
24814
  }
24773
24815
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24774
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-C1obEkji.js");
24816
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Bgb4ctNH.js");
24775
24817
  const prepared = preparePagesForExport(
24776
24818
  cloned.pages,
24777
24819
  canvasWidth,
@@ -27091,7 +27133,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27091
27133
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27092
27134
  sanitizeSvgTreeForPdf(svgToDraw);
27093
27135
  try {
27094
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-C1obEkji.js");
27136
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Bgb4ctNH.js");
27095
27137
  try {
27096
27138
  await logTextMeasurementDiagnostic(svgToDraw);
27097
27139
  } catch {
@@ -27491,4 +27533,4 @@ export {
27491
27533
  buildTeaserBlurFlatKeys as y,
27492
27534
  collectFontDescriptorsFromConfig as z
27493
27535
  };
27494
- //# sourceMappingURL=index-Ddn4TvlA.js.map
27536
+ //# sourceMappingURL=index-DSa_E6-5.js.map