@pixldocs/canvas-renderer 0.5.327 → 0.5.329

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.
@@ -13775,75 +13775,29 @@ const PageCanvas = forwardRef(
13775
13775
  const asTop0 = obj.top ?? 0;
13776
13776
  const asRect0 = obj.getBoundingRect();
13777
13777
  let didReflowTextChild = false;
13778
- for (const child of hasRotatedChild ? [] : obj.getObjects()) {
13778
+ if (hasRotatedChild) {
13779
+ if (isXSide) {
13780
+ obj._set("width", asW0 * sAxis);
13781
+ obj._set("scaleX", 1);
13782
+ } else {
13783
+ obj._set("height", asH0 * sAxis);
13784
+ obj._set("scaleY", 1);
13785
+ }
13786
+ }
13787
+ const childCounterScale = hasRotatedChild ? 1 : 1 / sAxis;
13788
+ for (const child of obj.getObjects()) {
13779
13789
  if (child instanceof fabric.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
13780
- const ct = child.__cropData;
13781
- if (!ct) continue;
13782
- if (isXSide) {
13783
- if (child.__asLiveOrigW == null) {
13784
- const baseW = child.width ?? ct.frameW ?? 0;
13785
- child.__asLiveOrigW = baseW * (child.scaleX ?? 1);
13786
- }
13787
- const origW = child.__asLiveOrigW;
13788
- const newW = Math.max(20, origW * sAxis);
13789
- if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13790
- ct.frameW = newW;
13791
- child._set("width", newW);
13792
- child._set("scaleX", 1 / sAxis);
13793
- try {
13794
- updateCoverLayout(child);
13795
- } catch {
13796
- }
13797
- child.setCoords();
13798
- child.dirty = true;
13799
- }
13800
- } else {
13801
- if (child.__asLiveOrigH == null) {
13802
- const baseH = child.height ?? ct.frameH ?? 0;
13803
- child.__asLiveOrigH = baseH * (child.scaleY ?? 1);
13804
- }
13805
- const origH = child.__asLiveOrigH;
13806
- const newH = Math.max(20, origH * sAxis);
13807
- if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13808
- ct.frameH = newH;
13809
- child._set("height", newH);
13810
- child._set("scaleY", 1 / sAxis);
13811
- try {
13812
- updateCoverLayout(child);
13813
- } catch {
13814
- }
13815
- child.setCoords();
13816
- child.dirty = true;
13817
- }
13818
- }
13790
+ if (isXSide) child._set("scaleX", childCounterScale);
13791
+ else child._set("scaleY", childCounterScale);
13792
+ child.setCoords();
13793
+ child.dirty = true;
13819
13794
  continue;
13820
13795
  }
13821
13796
  if (child instanceof fabric.FabricImage && !child.__cropGroup && !child.smartElementType) {
13822
- if (isXSide) {
13823
- if (child.__asLiveOrigW == null) {
13824
- child.__asLiveOrigW = (child.width ?? 0) * (child.scaleX ?? 1);
13825
- }
13826
- const origW = child.__asLiveOrigW;
13827
- const newW = Math.max(1, origW * sAxis);
13828
- if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13829
- child._set("width", newW);
13830
- child._set("scaleX", 1 / sAxis);
13831
- child.setCoords();
13832
- child.dirty = true;
13833
- }
13834
- } else {
13835
- if (child.__asLiveOrigH == null) {
13836
- child.__asLiveOrigH = (child.height ?? 0) * (child.scaleY ?? 1);
13837
- }
13838
- const origH = child.__asLiveOrigH;
13839
- const newH = Math.max(1, origH * sAxis);
13840
- if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13841
- child._set("height", newH);
13842
- child._set("scaleY", 1 / sAxis);
13843
- child.setCoords();
13844
- child.dirty = true;
13845
- }
13846
- }
13797
+ if (isXSide) child._set("scaleX", childCounterScale);
13798
+ else child._set("scaleY", childCounterScale);
13799
+ child.setCoords();
13800
+ child.dirty = true;
13847
13801
  continue;
13848
13802
  }
13849
13803
  if (!(child instanceof fabric.Textbox)) continue;
@@ -13855,7 +13809,7 @@ const PageCanvas = forwardRef(
13855
13809
  const newW = Math.max(20, origW * sAxis);
13856
13810
  if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13857
13811
  child._set("width", newW);
13858
- child._set("scaleX", 1 / sAxis);
13812
+ child._set("scaleX", childCounterScale);
13859
13813
  try {
13860
13814
  child.initDimensions();
13861
13815
  } catch {
@@ -13871,7 +13825,7 @@ const PageCanvas = forwardRef(
13871
13825
  const origH = child.__asLiveOrigH;
13872
13826
  const newH = Math.max(20, origH * sAxis);
13873
13827
  child.minBoxHeight = newH;
13874
- child._set("scaleY", 1 / sAxis);
13828
+ child._set("scaleY", childCounterScale);
13875
13829
  try {
13876
13830
  child.initDimensions();
13877
13831
  } catch {
@@ -24258,9 +24212,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24258
24212
  }
24259
24213
  return svgString;
24260
24214
  }
24261
- const resolvedPackageVersion = "0.5.327";
24215
+ const resolvedPackageVersion = "0.5.329";
24262
24216
  const PACKAGE_VERSION = resolvedPackageVersion;
24263
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.327";
24217
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.329";
24264
24218
  const roundParityValue = (value) => {
24265
24219
  if (typeof value !== "number") return value;
24266
24220
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25074,7 +25028,7 @@ class PixldocsRenderer {
25074
25028
  await this.waitForCanvasScene(container, cloned, i);
25075
25029
  }
25076
25030
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25077
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DE3LhODY.js");
25031
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BhmhaCT1.js");
25078
25032
  const prepared = preparePagesForExport(
25079
25033
  cloned.pages,
25080
25034
  canvasWidth,
@@ -27394,7 +27348,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27394
27348
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27395
27349
  sanitizeSvgTreeForPdf(svgToDraw);
27396
27350
  try {
27397
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DE3LhODY.js");
27351
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BhmhaCT1.js");
27398
27352
  try {
27399
27353
  await logTextMeasurementDiagnostic(svgToDraw);
27400
27354
  } catch {
@@ -27794,4 +27748,4 @@ export {
27794
27748
  buildTeaserBlurFlatKeys as y,
27795
27749
  collectFontDescriptorsFromConfig as z
27796
27750
  };
27797
- //# sourceMappingURL=index-LJNw8NgB.js.map
27751
+ //# sourceMappingURL=index-K53gPk1O.js.map