@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.
@@ -13432,7 +13432,7 @@ const PageCanvas = react.forwardRef(
13432
13432
  fabricCanvas.on("selection:cleared", () => {
13433
13433
  });
13434
13434
  fabricCanvas.on("object:scaling", (e) => {
13435
- var _a2, _b2;
13435
+ var _a2, _b2, _c;
13436
13436
  if (!isActiveRef.current) return;
13437
13437
  const t = e.target;
13438
13438
  if (t) lastResizeScaleTargetRef.current = t;
@@ -13618,6 +13618,48 @@ const PageCanvas = react.forwardRef(
13618
13618
  const asRect0 = obj.getBoundingRect();
13619
13619
  let didReflowTextChild = false;
13620
13620
  for (const child of obj.getObjects()) {
13621
+ if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_b2 = child._ct) == null ? void 0 : _b2.isCropGroup))) {
13622
+ const ct = child.__cropData;
13623
+ if (!ct) continue;
13624
+ if (isXSide) {
13625
+ if (child.__asLiveOrigW == null) {
13626
+ const baseW = child.width ?? ct.frameW ?? 0;
13627
+ child.__asLiveOrigW = baseW * (child.scaleX ?? 1);
13628
+ }
13629
+ const origW = child.__asLiveOrigW;
13630
+ const newW = Math.max(20, origW * sAxis);
13631
+ if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13632
+ ct.frameW = newW;
13633
+ child._set("width", newW);
13634
+ child._set("scaleX", 1 / sAxis);
13635
+ try {
13636
+ updateCoverLayout(child);
13637
+ } catch {
13638
+ }
13639
+ child.setCoords();
13640
+ child.dirty = true;
13641
+ }
13642
+ } else {
13643
+ if (child.__asLiveOrigH == null) {
13644
+ const baseH = child.height ?? ct.frameH ?? 0;
13645
+ child.__asLiveOrigH = baseH * (child.scaleY ?? 1);
13646
+ }
13647
+ const origH = child.__asLiveOrigH;
13648
+ const newH = Math.max(20, origH * sAxis);
13649
+ if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13650
+ ct.frameH = newH;
13651
+ child._set("height", newH);
13652
+ child._set("scaleY", 1 / sAxis);
13653
+ try {
13654
+ updateCoverLayout(child);
13655
+ } catch {
13656
+ }
13657
+ child.setCoords();
13658
+ child.dirty = true;
13659
+ }
13660
+ }
13661
+ continue;
13662
+ }
13621
13663
  if (child instanceof fabric__namespace.FabricImage && !child.__cropGroup && !child.smartElementType) {
13622
13664
  if (isXSide) {
13623
13665
  if (child.__asLiveOrigW == null) {
@@ -13794,7 +13836,7 @@ const PageCanvas = react.forwardRef(
13794
13836
  setGuides(gridGuidesForScale.length ? [...scaleGuides, ...gridGuidesForScale] : scaleGuides);
13795
13837
  if (drilledGroupIdRef.current) {
13796
13838
  try {
13797
- (_b2 = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _b2.call(fabricCanvas);
13839
+ (_c = fabricCanvas.__updateDrilledGroupOutline) == null ? void 0 : _c.call(fabricCanvas);
13798
13840
  } catch {
13799
13841
  }
13800
13842
  }
@@ -14525,8 +14567,8 @@ const PageCanvas = react.forwardRef(
14525
14567
  if (ct) {
14526
14568
  const sourceFrameW = Math.max(1, ct.frameW ?? obj.width ?? 1);
14527
14569
  const sourceFrameH = Math.max(1, ct.frameH ?? obj.height ?? 1);
14528
- const appliedScaleX = Math.abs(isActiveSelection && activeObj ? activeObj.scaleX ?? 1 : obj.scaleX ?? 1);
14529
- const appliedScaleY = Math.abs(isActiveSelection && activeObj ? activeObj.scaleY ?? 1 : obj.scaleY ?? 1);
14570
+ const appliedScaleX = isActiveSelection && activeObj ? Math.abs((activeObj.scaleX ?? 1) * (obj.scaleX ?? 1)) : Math.abs(obj.scaleX ?? 1);
14571
+ const appliedScaleY = isActiveSelection && activeObj ? Math.abs((activeObj.scaleY ?? 1) * (obj.scaleY ?? 1)) : Math.abs(obj.scaleY ?? 1);
14530
14572
  finalWidth = Math.max(1, sourceFrameW * appliedScaleX);
14531
14573
  finalHeight = Math.max(1, sourceFrameH * appliedScaleY);
14532
14574
  finalScaleX = 1;
@@ -23973,9 +24015,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23973
24015
  }
23974
24016
  return svgString;
23975
24017
  }
23976
- const resolvedPackageVersion = "0.5.299";
24018
+ const resolvedPackageVersion = "0.5.300";
23977
24019
  const PACKAGE_VERSION = resolvedPackageVersion;
23978
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.299";
24020
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.300";
23979
24021
  const roundParityValue = (value) => {
23980
24022
  if (typeof value !== "number") return value;
23981
24023
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24789,7 +24831,7 @@ class PixldocsRenderer {
24789
24831
  await this.waitForCanvasScene(container, cloned, i);
24790
24832
  }
24791
24833
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24792
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DeL1bsjM.cjs"));
24834
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BVHpWHXp.cjs"));
24793
24835
  const prepared = preparePagesForExport(
24794
24836
  cloned.pages,
24795
24837
  canvasWidth,
@@ -27109,7 +27151,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27109
27151
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27110
27152
  sanitizeSvgTreeForPdf(svgToDraw);
27111
27153
  try {
27112
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DeL1bsjM.cjs"));
27154
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BVHpWHXp.cjs"));
27113
27155
  try {
27114
27156
  await logTextMeasurementDiagnostic(svgToDraw);
27115
27157
  } catch {
@@ -27506,4 +27548,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27506
27548
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27507
27549
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27508
27550
  exports.warmTemplateFromForm = warmTemplateFromForm;
27509
- //# sourceMappingURL=index-DUUr9uZ0.cjs.map
27551
+ //# sourceMappingURL=index-eWyfu-3k.cjs.map