@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.
@@ -13844,26 +13844,29 @@ const PageCanvas = react.forwardRef(
13844
13844
  }
13845
13845
  if (isXSide && ((_e = groupShiftReflowSnapshotRef.current) == null ? void 0 : _e.selection) === obj) {
13846
13846
  const snap = groupShiftReflowSnapshotRef.current;
13847
- let prevBottom = -Infinity;
13847
+ const anchorEntry = snap.children[0];
13848
+ const anchorTopLive = anchorEntry.obj.top ?? 0;
13849
+ const anchorTop0 = anchorEntry.top0;
13850
+ const liveHeightOf = (entry) => {
13851
+ const c = entry.obj;
13852
+ if (c instanceof fabric__namespace.Textbox) return c.height ?? entry.height0;
13853
+ return (c.height ?? entry.height0) * Math.abs(c.scaleY ?? 1);
13854
+ };
13855
+ let prevBottom = anchorTopLive + liveHeightOf(anchorEntry);
13848
13856
  let didShift = false;
13849
- for (let i = 0; i < snap.children.length; i++) {
13857
+ for (let i = 1; i < snap.children.length; i++) {
13850
13858
  const entry = snap.children[i];
13851
13859
  const c = entry.obj;
13852
- let liveH;
13853
- if (c instanceof fabric__namespace.Textbox) {
13854
- liveH = c.height ?? entry.height0;
13855
- } else {
13856
- liveH = (c.height ?? entry.height0) * Math.abs(c.scaleY ?? 1);
13857
- }
13858
- const gap = i === 0 ? 0 : snap.gaps[i - 1];
13859
- const targetTop = i === 0 ? entry.top0 : Math.max(entry.top0, prevBottom + gap);
13860
+ const naturalTop = anchorTopLive + (entry.top0 - anchorTop0);
13861
+ const minTop = prevBottom + snap.gaps[i - 1];
13862
+ const targetTop = Math.max(naturalTop, minTop);
13860
13863
  if (Math.abs((c.top ?? 0) - targetTop) > 0.5) {
13861
13864
  c._set("top", targetTop);
13862
13865
  c.setCoords();
13863
13866
  c.dirty = true;
13864
13867
  didShift = true;
13865
13868
  }
13866
- prevBottom = targetTop + liveH;
13869
+ prevBottom = targetTop + liveHeightOf(entry);
13867
13870
  }
13868
13871
  if (didShift) didReflowTextChild = true;
13869
13872
  }
@@ -24176,9 +24179,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24176
24179
  }
24177
24180
  return svgString;
24178
24181
  }
24179
- const resolvedPackageVersion = "0.5.303";
24182
+ const resolvedPackageVersion = "0.5.304";
24180
24183
  const PACKAGE_VERSION = resolvedPackageVersion;
24181
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.303";
24184
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.304";
24182
24185
  const roundParityValue = (value) => {
24183
24186
  if (typeof value !== "number") return value;
24184
24187
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24992,7 +24995,7 @@ class PixldocsRenderer {
24992
24995
  await this.waitForCanvasScene(container, cloned, i);
24993
24996
  }
24994
24997
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24995
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BWWx6ATR.cjs"));
24998
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BwdX7s-7.cjs"));
24996
24999
  const prepared = preparePagesForExport(
24997
25000
  cloned.pages,
24998
25001
  canvasWidth,
@@ -27312,7 +27315,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27312
27315
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27313
27316
  sanitizeSvgTreeForPdf(svgToDraw);
27314
27317
  try {
27315
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BWWx6ATR.cjs"));
27318
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BwdX7s-7.cjs"));
27316
27319
  try {
27317
27320
  await logTextMeasurementDiagnostic(svgToDraw);
27318
27321
  } catch {
@@ -27709,4 +27712,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27709
27712
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27710
27713
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27711
27714
  exports.warmTemplateFromForm = warmTemplateFromForm;
27712
- //# sourceMappingURL=index-RzHOtjZi.cjs.map
27715
+ //# sourceMappingURL=index-C4r2zesf.cjs.map