@pixldocs/canvas-renderer 0.5.303 → 0.5.305

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,27 @@ 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
+ 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 targetTop = prevBottom + snap.gaps[i - 1];
13842
13843
  if (Math.abs((c.top ?? 0) - targetTop) > 0.5) {
13843
13844
  c._set("top", targetTop);
13844
13845
  c.setCoords();
13845
13846
  c.dirty = true;
13846
13847
  didShift = true;
13847
13848
  }
13848
- prevBottom = targetTop + liveH;
13849
+ prevBottom = targetTop + liveHeightOf(entry);
13849
13850
  }
13850
13851
  if (didShift) didReflowTextChild = true;
13851
13852
  }
@@ -24158,9 +24159,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24158
24159
  }
24159
24160
  return svgString;
24160
24161
  }
24161
- const resolvedPackageVersion = "0.5.303";
24162
+ const resolvedPackageVersion = "0.5.305";
24162
24163
  const PACKAGE_VERSION = resolvedPackageVersion;
24163
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.303";
24164
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.305";
24164
24165
  const roundParityValue = (value) => {
24165
24166
  if (typeof value !== "number") return value;
24166
24167
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24974,7 +24975,7 @@ class PixldocsRenderer {
24974
24975
  await this.waitForCanvasScene(container, cloned, i);
24975
24976
  }
24976
24977
  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");
24978
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BwMJ3-iw.js");
24978
24979
  const prepared = preparePagesForExport(
24979
24980
  cloned.pages,
24980
24981
  canvasWidth,
@@ -27294,7 +27295,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27294
27295
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27295
27296
  sanitizeSvgTreeForPdf(svgToDraw);
27296
27297
  try {
27297
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-DlOAYoOr.js");
27298
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BwMJ3-iw.js");
27298
27299
  try {
27299
27300
  await logTextMeasurementDiagnostic(svgToDraw);
27300
27301
  } catch {
@@ -27694,4 +27695,4 @@ export {
27694
27695
  buildTeaserBlurFlatKeys as y,
27695
27696
  collectFontDescriptorsFromConfig as z
27696
27697
  };
27697
- //# sourceMappingURL=index-BZNOM2c8.js.map
27698
+ //# sourceMappingURL=index-fZq9e7bO.js.map