@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.
@@ -13793,75 +13793,29 @@ const PageCanvas = react.forwardRef(
13793
13793
  const asTop0 = obj.top ?? 0;
13794
13794
  const asRect0 = obj.getBoundingRect();
13795
13795
  let didReflowTextChild = false;
13796
- for (const child of hasRotatedChild ? [] : obj.getObjects()) {
13796
+ if (hasRotatedChild) {
13797
+ if (isXSide) {
13798
+ obj._set("width", asW0 * sAxis);
13799
+ obj._set("scaleX", 1);
13800
+ } else {
13801
+ obj._set("height", asH0 * sAxis);
13802
+ obj._set("scaleY", 1);
13803
+ }
13804
+ }
13805
+ const childCounterScale = hasRotatedChild ? 1 : 1 / sAxis;
13806
+ for (const child of obj.getObjects()) {
13797
13807
  if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
13798
- const ct = child.__cropData;
13799
- if (!ct) continue;
13800
- if (isXSide) {
13801
- if (child.__asLiveOrigW == null) {
13802
- const baseW = child.width ?? ct.frameW ?? 0;
13803
- child.__asLiveOrigW = baseW * (child.scaleX ?? 1);
13804
- }
13805
- const origW = child.__asLiveOrigW;
13806
- const newW = Math.max(20, origW * sAxis);
13807
- if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13808
- ct.frameW = newW;
13809
- child._set("width", newW);
13810
- child._set("scaleX", 1 / sAxis);
13811
- try {
13812
- updateCoverLayout(child);
13813
- } catch {
13814
- }
13815
- child.setCoords();
13816
- child.dirty = true;
13817
- }
13818
- } else {
13819
- if (child.__asLiveOrigH == null) {
13820
- const baseH = child.height ?? ct.frameH ?? 0;
13821
- child.__asLiveOrigH = baseH * (child.scaleY ?? 1);
13822
- }
13823
- const origH = child.__asLiveOrigH;
13824
- const newH = Math.max(20, origH * sAxis);
13825
- if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13826
- ct.frameH = newH;
13827
- child._set("height", newH);
13828
- child._set("scaleY", 1 / sAxis);
13829
- try {
13830
- updateCoverLayout(child);
13831
- } catch {
13832
- }
13833
- child.setCoords();
13834
- child.dirty = true;
13835
- }
13836
- }
13808
+ if (isXSide) child._set("scaleX", childCounterScale);
13809
+ else child._set("scaleY", childCounterScale);
13810
+ child.setCoords();
13811
+ child.dirty = true;
13837
13812
  continue;
13838
13813
  }
13839
13814
  if (child instanceof fabric__namespace.FabricImage && !child.__cropGroup && !child.smartElementType) {
13840
- if (isXSide) {
13841
- if (child.__asLiveOrigW == null) {
13842
- child.__asLiveOrigW = (child.width ?? 0) * (child.scaleX ?? 1);
13843
- }
13844
- const origW = child.__asLiveOrigW;
13845
- const newW = Math.max(1, origW * sAxis);
13846
- if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13847
- child._set("width", newW);
13848
- child._set("scaleX", 1 / sAxis);
13849
- child.setCoords();
13850
- child.dirty = true;
13851
- }
13852
- } else {
13853
- if (child.__asLiveOrigH == null) {
13854
- child.__asLiveOrigH = (child.height ?? 0) * (child.scaleY ?? 1);
13855
- }
13856
- const origH = child.__asLiveOrigH;
13857
- const newH = Math.max(1, origH * sAxis);
13858
- if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13859
- child._set("height", newH);
13860
- child._set("scaleY", 1 / sAxis);
13861
- child.setCoords();
13862
- child.dirty = true;
13863
- }
13864
- }
13815
+ if (isXSide) child._set("scaleX", childCounterScale);
13816
+ else child._set("scaleY", childCounterScale);
13817
+ child.setCoords();
13818
+ child.dirty = true;
13865
13819
  continue;
13866
13820
  }
13867
13821
  if (!(child instanceof fabric__namespace.Textbox)) continue;
@@ -13873,7 +13827,7 @@ const PageCanvas = react.forwardRef(
13873
13827
  const newW = Math.max(20, origW * sAxis);
13874
13828
  if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13875
13829
  child._set("width", newW);
13876
- child._set("scaleX", 1 / sAxis);
13830
+ child._set("scaleX", childCounterScale);
13877
13831
  try {
13878
13832
  child.initDimensions();
13879
13833
  } catch {
@@ -13889,7 +13843,7 @@ const PageCanvas = react.forwardRef(
13889
13843
  const origH = child.__asLiveOrigH;
13890
13844
  const newH = Math.max(20, origH * sAxis);
13891
13845
  child.minBoxHeight = newH;
13892
- child._set("scaleY", 1 / sAxis);
13846
+ child._set("scaleY", childCounterScale);
13893
13847
  try {
13894
13848
  child.initDimensions();
13895
13849
  } catch {
@@ -24276,9 +24230,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24276
24230
  }
24277
24231
  return svgString;
24278
24232
  }
24279
- const resolvedPackageVersion = "0.5.327";
24233
+ const resolvedPackageVersion = "0.5.329";
24280
24234
  const PACKAGE_VERSION = resolvedPackageVersion;
24281
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.327";
24235
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.329";
24282
24236
  const roundParityValue = (value) => {
24283
24237
  if (typeof value !== "number") return value;
24284
24238
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25092,7 +25046,7 @@ class PixldocsRenderer {
25092
25046
  await this.waitForCanvasScene(container, cloned, i);
25093
25047
  }
25094
25048
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25095
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-wr9G37iK.cjs"));
25049
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DNaP0TIk.cjs"));
25096
25050
  const prepared = preparePagesForExport(
25097
25051
  cloned.pages,
25098
25052
  canvasWidth,
@@ -27412,7 +27366,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27412
27366
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27413
27367
  sanitizeSvgTreeForPdf(svgToDraw);
27414
27368
  try {
27415
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-wr9G37iK.cjs"));
27369
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DNaP0TIk.cjs"));
27416
27370
  try {
27417
27371
  await logTextMeasurementDiagnostic(svgToDraw);
27418
27372
  } catch {
@@ -27809,4 +27763,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27809
27763
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27810
27764
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27811
27765
  exports.warmTemplateFromForm = warmTemplateFromForm;
27812
- //# sourceMappingURL=index-CAK9gioW.cjs.map
27766
+ //# sourceMappingURL=index-_B1EJq7R.cjs.map