@pixldocs/canvas-renderer 0.5.287 → 0.5.288

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.
@@ -11000,10 +11000,12 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
11000
11000
  const sy = Math.abs(obj.scaleY ?? 1) || 1;
11001
11001
  if (Math.abs(sx - 1) < 1e-3 && Math.abs(sy - 1) < 1e-3) return null;
11002
11002
  const isUniform = Math.abs(sx - sy) < 0.01;
11003
- const fontScale = isUniform ? (sx + sy) / 2 : Math.abs(sy - 1) > 1e-3 ? sy : 1;
11003
+ const isHeightOnly = !isUniform && Math.abs(sx - 1) < 0.01 && Math.abs(sy - 1) > 1e-3;
11004
+ const fontScale = isUniform ? (sx + sy) / 2 : 1;
11004
11005
  const effectScale = isUniform ? fontScale : Math.max(1e-3, Math.sqrt(sx * sy));
11006
+ const newWidth = isHeightOnly ? obj.width ?? (sourceElement == null ? void 0 : sourceElement.width) ?? 20 : Math.max(20, (obj.width ?? (sourceElement == null ? void 0 : sourceElement.width) ?? 20) * sx);
11005
11007
  const updates = {
11006
- width: Math.max(20, (obj.width ?? (sourceElement == null ? void 0 : sourceElement.width) ?? 20) * sx),
11008
+ width: newWidth,
11007
11009
  scaleX: 1,
11008
11010
  scaleY: 1
11009
11011
  };
@@ -11011,6 +11013,10 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
11011
11013
  updates.fontSize = Math.max(1, Number(obj.fontSize || (sourceElement == null ? void 0 : sourceElement.fontSize) || 16) * fontScale);
11012
11014
  const minBoxHeight = Number(obj.minBoxHeight ?? (sourceElement == null ? void 0 : sourceElement.minBoxHeight));
11013
11015
  if (Number.isFinite(minBoxHeight) && minBoxHeight > 0) updates.minBoxHeight = minBoxHeight * sy;
11016
+ } else if (isHeightOnly) {
11017
+ const baseMinH = Number(obj.minBoxHeight ?? (sourceElement == null ? void 0 : sourceElement.minBoxHeight));
11018
+ const baselineH = Number.isFinite(baseMinH) && baseMinH > 0 ? baseMinH : obj.height ?? (sourceElement == null ? void 0 : sourceElement.height) ?? 0;
11019
+ if (baselineH > 0) updates.minBoxHeight = Math.max(0, baselineH * sy);
11014
11020
  }
11015
11021
  scaleUpdateNumber(updates, sourceElement ?? void 0, "strokeWidth", effectScale);
11016
11022
  scaleUpdateNumber(updates, sourceElement ?? void 0, "textShadowBlur", effectScale);
@@ -23619,9 +23625,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23619
23625
  }
23620
23626
  return svgString;
23621
23627
  }
23622
- const resolvedPackageVersion = "0.5.287";
23628
+ const resolvedPackageVersion = "0.5.288";
23623
23629
  const PACKAGE_VERSION = resolvedPackageVersion;
23624
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.287";
23630
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.288";
23625
23631
  const roundParityValue = (value) => {
23626
23632
  if (typeof value !== "number") return value;
23627
23633
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24435,7 +24441,7 @@ class PixldocsRenderer {
24435
24441
  await this.waitForCanvasScene(container, cloned, i);
24436
24442
  }
24437
24443
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24438
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-Cdzd1M4c.js");
24444
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-BeBLRc4B.js");
24439
24445
  const prepared = preparePagesForExport(
24440
24446
  cloned.pages,
24441
24447
  canvasWidth,
@@ -26755,7 +26761,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26755
26761
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26756
26762
  sanitizeSvgTreeForPdf(svgToDraw);
26757
26763
  try {
26758
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-Cdzd1M4c.js");
26764
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-BeBLRc4B.js");
26759
26765
  try {
26760
26766
  await logTextMeasurementDiagnostic(svgToDraw);
26761
26767
  } catch {
@@ -27155,4 +27161,4 @@ export {
27155
27161
  buildTeaserBlurFlatKeys as y,
27156
27162
  collectFontDescriptorsFromConfig as z
27157
27163
  };
27158
- //# sourceMappingURL=index-SOarDnbw.js.map
27164
+ //# sourceMappingURL=index-Dc3vuyOU.js.map