@pixldocs/canvas-renderer 0.5.326 → 0.5.328

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.
@@ -13736,6 +13736,10 @@ const PageCanvas = forwardRef(
13736
13736
  const isXSide = corner === "ml" || corner === "mr";
13737
13737
  const sAxis = isXSide ? Math.abs(obj.scaleX ?? 1) : Math.abs(obj.scaleY ?? 1);
13738
13738
  if (sAxis > 1e-3) {
13739
+ const hasRotatedChild = obj.getObjects().some((c) => {
13740
+ const a = ((c.angle ?? 0) % 180 + 180) % 180;
13741
+ return !(a < 0.5 || a > 179.5);
13742
+ });
13739
13743
  if (isXSide && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
13740
13744
  groupShiftReflowSnapshotRef.current = null;
13741
13745
  const logicalGroupId = obj.__pixldocsGroupSelection;
@@ -13771,6 +13775,16 @@ const PageCanvas = forwardRef(
13771
13775
  const asTop0 = obj.top ?? 0;
13772
13776
  const asRect0 = obj.getBoundingRect();
13773
13777
  let didReflowTextChild = false;
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;
13774
13788
  for (const child of obj.getObjects()) {
13775
13789
  if (child instanceof fabric.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
13776
13790
  const ct = child.__cropData;
@@ -13785,7 +13799,7 @@ const PageCanvas = forwardRef(
13785
13799
  if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13786
13800
  ct.frameW = newW;
13787
13801
  child._set("width", newW);
13788
- child._set("scaleX", 1 / sAxis);
13802
+ child._set("scaleX", childCounterScale);
13789
13803
  try {
13790
13804
  updateCoverLayout(child);
13791
13805
  } catch {
@@ -13803,7 +13817,7 @@ const PageCanvas = forwardRef(
13803
13817
  if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13804
13818
  ct.frameH = newH;
13805
13819
  child._set("height", newH);
13806
- child._set("scaleY", 1 / sAxis);
13820
+ child._set("scaleY", childCounterScale);
13807
13821
  try {
13808
13822
  updateCoverLayout(child);
13809
13823
  } catch {
@@ -13823,7 +13837,7 @@ const PageCanvas = forwardRef(
13823
13837
  const newW = Math.max(1, origW * sAxis);
13824
13838
  if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13825
13839
  child._set("width", newW);
13826
- child._set("scaleX", 1 / sAxis);
13840
+ child._set("scaleX", childCounterScale);
13827
13841
  child.setCoords();
13828
13842
  child.dirty = true;
13829
13843
  }
@@ -13835,7 +13849,7 @@ const PageCanvas = forwardRef(
13835
13849
  const newH = Math.max(1, origH * sAxis);
13836
13850
  if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13837
13851
  child._set("height", newH);
13838
- child._set("scaleY", 1 / sAxis);
13852
+ child._set("scaleY", childCounterScale);
13839
13853
  child.setCoords();
13840
13854
  child.dirty = true;
13841
13855
  }
@@ -13851,7 +13865,7 @@ const PageCanvas = forwardRef(
13851
13865
  const newW = Math.max(20, origW * sAxis);
13852
13866
  if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13853
13867
  child._set("width", newW);
13854
- child._set("scaleX", 1 / sAxis);
13868
+ child._set("scaleX", childCounterScale);
13855
13869
  try {
13856
13870
  child.initDimensions();
13857
13871
  } catch {
@@ -13867,7 +13881,7 @@ const PageCanvas = forwardRef(
13867
13881
  const origH = child.__asLiveOrigH;
13868
13882
  const newH = Math.max(20, origH * sAxis);
13869
13883
  child.minBoxHeight = newH;
13870
- child._set("scaleY", 1 / sAxis);
13884
+ child._set("scaleY", childCounterScale);
13871
13885
  try {
13872
13886
  child.initDimensions();
13873
13887
  } catch {
@@ -13942,6 +13956,15 @@ const PageCanvas = forwardRef(
13942
13956
  obj._set("width", asW0);
13943
13957
  obj._set("scaleX", asSx0);
13944
13958
  obj._set("scaleY", asSy0);
13959
+ if (hasRotatedChild) {
13960
+ if (isXSide) {
13961
+ obj._set("width", asW0 * sAxis);
13962
+ obj._set("scaleX", 1);
13963
+ } else {
13964
+ obj._set("height", asH0 * sAxis);
13965
+ obj._set("scaleY", 1);
13966
+ }
13967
+ }
13945
13968
  obj.setCoords();
13946
13969
  obj.dirty = true;
13947
13970
  }
@@ -24245,9 +24268,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24245
24268
  }
24246
24269
  return svgString;
24247
24270
  }
24248
- const resolvedPackageVersion = "0.5.326";
24271
+ const resolvedPackageVersion = "0.5.328";
24249
24272
  const PACKAGE_VERSION = resolvedPackageVersion;
24250
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.326";
24273
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.328";
24251
24274
  const roundParityValue = (value) => {
24252
24275
  if (typeof value !== "number") return value;
24253
24276
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25061,7 +25084,7 @@ class PixldocsRenderer {
25061
25084
  await this.waitForCanvasScene(container, cloned, i);
25062
25085
  }
25063
25086
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25064
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-N0-ZYAKl.js");
25087
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-CKg43wpe.js");
25065
25088
  const prepared = preparePagesForExport(
25066
25089
  cloned.pages,
25067
25090
  canvasWidth,
@@ -27381,7 +27404,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27381
27404
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27382
27405
  sanitizeSvgTreeForPdf(svgToDraw);
27383
27406
  try {
27384
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-N0-ZYAKl.js");
27407
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-CKg43wpe.js");
27385
27408
  try {
27386
27409
  await logTextMeasurementDiagnostic(svgToDraw);
27387
27410
  } catch {
@@ -27781,4 +27804,4 @@ export {
27781
27804
  buildTeaserBlurFlatKeys as y,
27782
27805
  collectFontDescriptorsFromConfig as z
27783
27806
  };
27784
- //# sourceMappingURL=index-CXrA6xYG.js.map
27807
+ //# sourceMappingURL=index-36ORX_k2.js.map