@pixldocs/canvas-renderer 0.5.303 → 0.5.304

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.
@@ -13826,26 +13826,29 @@ const PageCanvas = forwardRef(
13826
13826
  }
13827
13827
  if (isXSide && ((_e = groupShiftReflowSnapshotRef.current) == null ? void 0 : _e.selection) === obj) {
13828
13828
  const snap = groupShiftReflowSnapshotRef.current;
13829
- let prevBottom = -Infinity;
13829
+ const anchorEntry = snap.children[0];
13830
+ const anchorTopLive = anchorEntry.obj.top ?? 0;
13831
+ const anchorTop0 = anchorEntry.top0;
13832
+ const liveHeightOf = (entry) => {
13833
+ const c = entry.obj;
13834
+ if (c instanceof fabric.Textbox) return c.height ?? entry.height0;
13835
+ return (c.height ?? entry.height0) * Math.abs(c.scaleY ?? 1);
13836
+ };
13837
+ let prevBottom = anchorTopLive + liveHeightOf(anchorEntry);
13830
13838
  let didShift = false;
13831
- for (let i = 0; i < snap.children.length; i++) {
13839
+ for (let i = 1; i < snap.children.length; i++) {
13832
13840
  const entry = snap.children[i];
13833
13841
  const c = entry.obj;
13834
- let liveH;
13835
- if (c instanceof fabric.Textbox) {
13836
- liveH = c.height ?? entry.height0;
13837
- } else {
13838
- liveH = (c.height ?? entry.height0) * Math.abs(c.scaleY ?? 1);
13839
- }
13840
- const gap = i === 0 ? 0 : snap.gaps[i - 1];
13841
- const targetTop = i === 0 ? entry.top0 : Math.max(entry.top0, prevBottom + gap);
13842
+ const naturalTop = anchorTopLive + (entry.top0 - anchorTop0);
13843
+ const minTop = prevBottom + snap.gaps[i - 1];
13844
+ const targetTop = Math.max(naturalTop, minTop);
13842
13845
  if (Math.abs((c.top ?? 0) - targetTop) > 0.5) {
13843
13846
  c._set("top", targetTop);
13844
13847
  c.setCoords();
13845
13848
  c.dirty = true;
13846
13849
  didShift = true;
13847
13850
  }
13848
- prevBottom = targetTop + liveH;
13851
+ prevBottom = targetTop + liveHeightOf(entry);
13849
13852
  }
13850
13853
  if (didShift) didReflowTextChild = true;
13851
13854
  }
@@ -24158,9 +24161,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24158
24161
  }
24159
24162
  return svgString;
24160
24163
  }
24161
- const resolvedPackageVersion = "0.5.303";
24164
+ const resolvedPackageVersion = "0.5.304";
24162
24165
  const PACKAGE_VERSION = resolvedPackageVersion;
24163
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.303";
24166
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.304";
24164
24167
  const roundParityValue = (value) => {
24165
24168
  if (typeof value !== "number") return value;
24166
24169
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24974,7 +24977,7 @@ class PixldocsRenderer {
24974
24977
  await this.waitForCanvasScene(container, cloned, i);
24975
24978
  }
24976
24979
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24977
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-DlOAYoOr.js");
24980
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-M5_Qv3Nm.js");
24978
24981
  const prepared = preparePagesForExport(
24979
24982
  cloned.pages,
24980
24983
  canvasWidth,
@@ -27294,7 +27297,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27294
27297
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27295
27298
  sanitizeSvgTreeForPdf(svgToDraw);
27296
27299
  try {
27297
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DlOAYoOr.js");
27300
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-M5_Qv3Nm.js");
27298
27301
  try {
27299
27302
  await logTextMeasurementDiagnostic(svgToDraw);
27300
27303
  } catch {
@@ -27694,4 +27697,4 @@ export {
27694
27697
  buildTeaserBlurFlatKeys as y,
27695
27698
  collectFontDescriptorsFromConfig as z
27696
27699
  };
27697
- //# sourceMappingURL=index-BZNOM2c8.js.map
27700
+ //# sourceMappingURL=index-Cxt1LQoh.js.map