@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.
@@ -13844,26 +13844,27 @@ 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
+ 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 targetTop = prevBottom + snap.gaps[i - 1];
13860
13861
  if (Math.abs((c.top ?? 0) - targetTop) > 0.5) {
13861
13862
  c._set("top", targetTop);
13862
13863
  c.setCoords();
13863
13864
  c.dirty = true;
13864
13865
  didShift = true;
13865
13866
  }
13866
- prevBottom = targetTop + liveH;
13867
+ prevBottom = targetTop + liveHeightOf(entry);
13867
13868
  }
13868
13869
  if (didShift) didReflowTextChild = true;
13869
13870
  }
@@ -24176,9 +24177,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
24176
24177
  }
24177
24178
  return svgString;
24178
24179
  }
24179
- const resolvedPackageVersion = "0.5.303";
24180
+ const resolvedPackageVersion = "0.5.305";
24180
24181
  const PACKAGE_VERSION = resolvedPackageVersion;
24181
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.303";
24182
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.305";
24182
24183
  const roundParityValue = (value) => {
24183
24184
  if (typeof value !== "number") return value;
24184
24185
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24992,7 +24993,7 @@ class PixldocsRenderer {
24992
24993
  await this.waitForCanvasScene(container, cloned, i);
24993
24994
  }
24994
24995
  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"));
24996
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-fYp0UsD2.cjs"));
24996
24997
  const prepared = preparePagesForExport(
24997
24998
  cloned.pages,
24998
24999
  canvasWidth,
@@ -27312,7 +27313,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
27312
27313
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
27313
27314
  sanitizeSvgTreeForPdf(svgToDraw);
27314
27315
  try {
27315
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BWWx6ATR.cjs"));
27316
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-fYp0UsD2.cjs"));
27316
27317
  try {
27317
27318
  await logTextMeasurementDiagnostic(svgToDraw);
27318
27319
  } catch {
@@ -27709,4 +27710,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27709
27710
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27710
27711
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27711
27712
  exports.warmTemplateFromForm = warmTemplateFromForm;
27712
- //# sourceMappingURL=index-RzHOtjZi.cjs.map
27713
+ //# sourceMappingURL=index-C8ZNStHz.cjs.map