@pixldocs/canvas-renderer 0.5.298 → 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,76 @@ 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
+ }
13645
+ if (child instanceof fabric.FabricImage && !child.__cropGroup && !child.smartElementType) {
13646
+ if (isXSide) {
13647
+ if (child.__asLiveOrigW == null) {
13648
+ child.__asLiveOrigW = (child.width ?? 0) * (child.scaleX ?? 1);
13649
+ }
13650
+ const origW = child.__asLiveOrigW;
13651
+ const newW = Math.max(1, origW * sAxis);
13652
+ if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13653
+ child._set("width", newW);
13654
+ child._set("scaleX", 1 / sAxis);
13655
+ child.setCoords();
13656
+ child.dirty = true;
13657
+ }
13658
+ } else {
13659
+ if (child.__asLiveOrigH == null) {
13660
+ child.__asLiveOrigH = (child.height ?? 0) * (child.scaleY ?? 1);
13661
+ }
13662
+ const origH = child.__asLiveOrigH;
13663
+ const newH = Math.max(1, origH * sAxis);
13664
+ if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13665
+ child._set("height", newH);
13666
+ child._set("scaleY", 1 / sAxis);
13667
+ child.setCoords();
13668
+ child.dirty = true;
13669
+ }
13670
+ }
13671
+ continue;
13672
+ }
13603
13673
  if (!(child instanceof fabric.Textbox)) continue;
13604
13674
  if (isXSide) {
13605
13675
  if (child.__asLiveOrigW == null) {
@@ -13748,7 +13818,7 @@ const PageCanvas = forwardRef(
13748
13818
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
13749
13819
  if (drilledGroupIdRef.current) {
13750
13820
  try {
13751
- (_b2 = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _b2.call(fabricCanvas);
13821
+ (_c = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _c.call(fabricCanvas);
13752
13822
  } catch {
13753
13823
  }
13754
13824
  }
@@ -14479,8 +14549,8 @@ const PageCanvas = forwardRef(
14479
14549
  if (ct) {
14480
14550
  const sourceFrameW = Math.max(1, ct.frameW ?? obj.width ?? 1);
14481
14551
  const sourceFrameH = Math.max(1, ct.frameH ?? obj.height ?? 1);
14482
- const appliedScaleX = Math.abs(isActiveSelection && activeObj ? activeObj.scaleX ?? 1 : obj.scaleX ?? 1);
14483
- 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);
14484
14554
  finalWidth = Math.max(1, sourceFrameW * appliedScaleX);
14485
14555
  finalHeight = Math.max(1, sourceFrameH * appliedScaleY);
14486
14556
  finalScaleX = 1;
@@ -23927,9 +23997,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23927
23997
  }
23928
23998
  return svgString;
23929
23999
  }
23930
- const resolvedPackageVersion = "0.5.298";
24000
+ const resolvedPackageVersion = "0.5.300";
23931
24001
  const PACKAGE_VERSION = resolvedPackageVersion;
23932
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.298";
24002
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.300";
23933
24003
  const roundParityValue = (value) => {
23934
24004
  if (typeof value !== "number") return value;
23935
24005
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24743,7 +24813,7 @@ class PixldocsRenderer {
24743
24813
  await this.waitForCanvasScene(container, cloned, i);
24744
24814
  }
24745
24815
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24746
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CL-maCe-.js");
24816
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Bgb4ctNH.js");
24747
24817
  const prepared = preparePagesForExport(
24748
24818
  cloned.pages,
24749
24819
  canvasWidth,
@@ -27063,7 +27133,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27063
27133
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27064
27134
  sanitizeSvgTreeForPdf(svgToDraw);
27065
27135
  try {
27066
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CL-maCe-.js");
27136
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Bgb4ctNH.js");
27067
27137
  try {
27068
27138
  await logTextMeasurementDiagnostic(svgToDraw);
27069
27139
  } catch {
@@ -27463,4 +27533,4 @@ export {
27463
27533
  buildTeaserBlurFlatKeys as y,
27464
27534
  collectFontDescriptorsFromConfig as z
27465
27535
  };
27466
- //# sourceMappingURL=index-72P860wB.js.map
27536
+ //# sourceMappingURL=index-DSa_E6-5.js.map