@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.
@@ -11018,10 +11018,12 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
11018
11018
  const sy = Math.abs(obj.scaleY ?? 1) || 1;
11019
11019
  if (Math.abs(sx - 1) < 1e-3 && Math.abs(sy - 1) < 1e-3) return null;
11020
11020
  const isUniform = Math.abs(sx - sy) < 0.01;
11021
- const fontScale = isUniform ? (sx + sy) / 2 : Math.abs(sy - 1) > 1e-3 ? sy : 1;
11021
+ const isHeightOnly = !isUniform && Math.abs(sx - 1) < 0.01 && Math.abs(sy - 1) > 1e-3;
11022
+ const fontScale = isUniform ? (sx + sy) / 2 : 1;
11022
11023
  const effectScale = isUniform ? fontScale : Math.max(1e-3, Math.sqrt(sx * sy));
11024
+ 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);
11023
11025
  const updates = {
11024
- width: Math.max(20, (obj.width ?? (sourceElement == null ? void 0 : sourceElement.width) ?? 20) * sx),
11026
+ width: newWidth,
11025
11027
  scaleX: 1,
11026
11028
  scaleY: 1
11027
11029
  };
@@ -11029,6 +11031,10 @@ const bakeTextboxScaleIntoTypography = (obj, sourceElement) => {
11029
11031
  updates.fontSize = Math.max(1, Number(obj.fontSize || (sourceElement == null ? void 0 : sourceElement.fontSize) || 16) * fontScale);
11030
11032
  const minBoxHeight = Number(obj.minBoxHeight ?? (sourceElement == null ? void 0 : sourceElement.minBoxHeight));
11031
11033
  if (Number.isFinite(minBoxHeight) && minBoxHeight > 0) updates.minBoxHeight = minBoxHeight * sy;
11034
+ } else if (isHeightOnly) {
11035
+ const baseMinH = Number(obj.minBoxHeight ?? (sourceElement == null ? void 0 : sourceElement.minBoxHeight));
11036
+ const baselineH = Number.isFinite(baseMinH) && baseMinH > 0 ? baseMinH : obj.height ?? (sourceElement == null ? void 0 : sourceElement.height) ?? 0;
11037
+ if (baselineH > 0) updates.minBoxHeight = Math.max(0, baselineH * sy);
11032
11038
  }
11033
11039
  scaleUpdateNumber(updates, sourceElement ?? void 0, "strokeWidth", effectScale);
11034
11040
  scaleUpdateNumber(updates, sourceElement ?? void 0, "textShadowBlur", effectScale);
@@ -23637,9 +23643,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
23637
23643
  }
23638
23644
  return svgString;
23639
23645
  }
23640
- const resolvedPackageVersion = "0.5.287";
23646
+ const resolvedPackageVersion = "0.5.288";
23641
23647
  const PACKAGE_VERSION = resolvedPackageVersion;
23642
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.287";
23648
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.288";
23643
23649
  const roundParityValue = (value) => {
23644
23650
  if (typeof value !== "number") return value;
23645
23651
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -24453,7 +24459,7 @@ class PixldocsRenderer {
24453
24459
  await this.waitForCanvasScene(container, cloned, i);
24454
24460
  }
24455
24461
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
24456
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-PuXmC5oW.cjs"));
24462
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DUVeRe5f.cjs"));
24457
24463
  const prepared = preparePagesForExport(
24458
24464
  cloned.pages,
24459
24465
  canvasWidth,
@@ -26773,7 +26779,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
26773
26779
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
26774
26780
  sanitizeSvgTreeForPdf(svgToDraw);
26775
26781
  try {
26776
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-PuXmC5oW.cjs"));
26782
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DUVeRe5f.cjs"));
26777
26783
  try {
26778
26784
  await logTextMeasurementDiagnostic(svgToDraw);
26779
26785
  } catch {
@@ -27170,4 +27176,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
27170
27176
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
27171
27177
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
27172
27178
  exports.warmTemplateFromForm = warmTemplateFromForm;
27173
- //# sourceMappingURL=index-B8mo_6bC.cjs.map
27179
+ //# sourceMappingURL=index-BJkc3Hss.cjs.map