@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.
@@ -13754,6 +13754,10 @@ const PageCanvas = react.forwardRef(
13754
13754
  const isXSide = corner === "ml" || corner === "mr";
13755
13755
  const sAxis = isXSide ? Math.abs(obj.scaleX ?? 1) : Math.abs(obj.scaleY ?? 1);
13756
13756
  if (sAxis > 1e-3) {
13757
+ const hasRotatedChild = obj.getObjects().some((c) => {
13758
+ const a = ((c.angle ?? 0) % 180 + 180) % 180;
13759
+ return !(a < 0.5 || a > 179.5);
13760
+ });
13757
13761
  if (isXSide && ((_b2 = groupShiftReflowSnapshotRef.current) == null ? void 0 : _b2.selection) !== obj) {
13758
13762
  groupShiftReflowSnapshotRef.current = null;
13759
13763
  const logicalGroupId = obj.__pixldocsGroupSelection;
@@ -13789,6 +13793,16 @@ const PageCanvas = react.forwardRef(
13789
13793
  const asTop0 = obj.top ?? 0;
13790
13794
  const asRect0 = obj.getBoundingRect();
13791
13795
  let didReflowTextChild = false;
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;
13792
13806
  for (const child of obj.getObjects()) {
13793
13807
  if (child instanceof fabric__namespace.Group && (child.__cropGroup || ((_d = child._ct) == null ? void 0 : _d.isCropGroup))) {
13794
13808
  const ct = child.__cropData;
@@ -13803,7 +13817,7 @@ const PageCanvas = react.forwardRef(
13803
13817
  if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13804
13818
  ct.frameW = newW;
13805
13819
  child._set("width", newW);
13806
- child._set("scaleX", 1 / sAxis);
13820
+ child._set("scaleX", childCounterScale);
13807
13821
  try {
13808
13822
  updateCoverLayout(child);
13809
13823
  } catch {
@@ -13821,7 +13835,7 @@ const PageCanvas = react.forwardRef(
13821
13835
  if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13822
13836
  ct.frameH = newH;
13823
13837
  child._set("height", newH);
13824
- child._set("scaleY", 1 / sAxis);
13838
+ child._set("scaleY", childCounterScale);
13825
13839
  try {
13826
13840
  updateCoverLayout(child);
13827
13841
  } catch {
@@ -13841,7 +13855,7 @@ const PageCanvas = react.forwardRef(
13841
13855
  const newW = Math.max(1, origW * sAxis);
13842
13856
  if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13843
13857
  child._set("width", newW);
13844
- child._set("scaleX", 1 / sAxis);
13858
+ child._set("scaleX", childCounterScale);
13845
13859
  child.setCoords();
13846
13860
  child.dirty = true;
13847
13861
  }
@@ -13853,7 +13867,7 @@ const PageCanvas = react.forwardRef(
13853
13867
  const newH = Math.max(1, origH * sAxis);
13854
13868
  if (Math.abs((child.height ?? 0) - newH) > 0.5) {
13855
13869
  child._set("height", newH);
13856
- child._set("scaleY", 1 / sAxis);
13870
+ child._set("scaleY", childCounterScale);
13857
13871
  child.setCoords();
13858
13872
  child.dirty = true;
13859
13873
  }
@@ -13869,7 +13883,7 @@ const PageCanvas = react.forwardRef(
13869
13883
  const newW = Math.max(20, origW * sAxis);
13870
13884
  if (Math.abs((child.width ?? 0) - newW) > 0.5) {
13871
13885
  child._set("width", newW);
13872
- child._set("scaleX", 1 / sAxis);
13886
+ child._set("scaleX", childCounterScale);
13873
13887
  try {
13874
13888
  child.initDimensions();
13875
13889
  } catch {
@@ -13885,7 +13899,7 @@ const PageCanvas = react.forwardRef(
13885
13899
  const origH = child.__asLiveOrigH;
13886
13900
  const newH = Math.max(20, origH * sAxis);
13887
13901
  child.minBoxHeight = newH;
13888
- child._set("scaleY", 1 / sAxis);
13902
+ child._set("scaleY", childCounterScale);
13889
13903
  try {
13890
13904
  child.initDimensions();
13891
13905
  } catch {
@@ -13960,6 +13974,15 @@ const PageCanvas = react.forwardRef(
13960
13974
  obj._set("width", asW0);
13961
13975
  obj._set("scaleX", asSx0);
13962
13976
  obj._set("scaleY", asSy0);
13977
+ if (hasRotatedChild) {
13978
+ if (isXSide) {
13979
+ obj._set("width", asW0 * sAxis);
13980
+ obj._set("scaleX", 1);
13981
+ } else {
13982
+ obj._set("height", asH0 * sAxis);
13983
+ obj._set("scaleY", 1);
13984
+ }
13985
+ }
13963
13986
  obj.setCoords();
13964
13987
  obj.dirty = true;
13965
13988
  }
@@ -24263,9 +24286,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24263
24286
  }
24264
24287
  return svgString;
24265
24288
  }
24266
- const resolvedPackageVersion = "0.5.326";
24289
+ const resolvedPackageVersion = "0.5.328";
24267
24290
  const PACKAGE_VERSION = resolvedPackageVersion;
24268
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.326";
24291
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.328";
24269
24292
  const roundParityValue = (value) => {
24270
24293
  if (typeof value !== "number") return value;
24271
24294
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25079,7 +25102,7 @@ class PixldocsRenderer {
25079
25102
  await this.waitForCanvasScene(container, cloned, i);
25080
25103
  }
25081
25104
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25082
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CtjZ9wQ_.cjs"));
25105
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-B4Vpz8di.cjs"));
25083
25106
  const prepared = preparePagesForExport(
25084
25107
  cloned.pages,
25085
25108
  canvasWidth,
@@ -27399,7 +27422,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27399
27422
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27400
27423
  sanitizeSvgTreeForPdf(svgToDraw);
27401
27424
  try {
27402
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CtjZ9wQ_.cjs"));
27425
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-B4Vpz8di.cjs"));
27403
27426
  try {
27404
27427
  await logTextMeasurementDiagnostic(svgToDraw);
27405
27428
  } catch {
@@ -27796,4 +27819,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27796
27819
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27797
27820
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27798
27821
  exports.warmTemplateFromForm = warmTemplateFromForm;
27799
- //# sourceMappingURL=index-MMaqERXX.cjs.map
27822
+ //# sourceMappingURL=index-DhowYy-T.cjs.map