@pixldocs/canvas-renderer 0.5.471 → 0.5.473

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.
@@ -9626,8 +9626,9 @@ function gradientToFabric(gradient, width, height) {
9626
9626
  });
9627
9627
  }
9628
9628
  function applyInitialGradients(obj, element) {
9629
- const w = typeof obj.width === "number" && obj.width > 0 ? obj.width : Number(element.width) || 0;
9630
- const h = typeof obj.height === "number" && obj.height > 0 ? obj.height : Number(element.height) || 0;
9629
+ const isLine = element.type === "line";
9630
+ const w = typeof obj.width === "number" && obj.width > 0 ? obj.width : (Number(element.width) || 0) * (isLine ? Number(element.scaleX) || 1 : 1);
9631
+ const h = typeof obj.height === "number" && obj.height > 0 ? obj.height : isLine ? Math.max(Number(element.strokeWidth) || 0, 1) : Number(element.height) || 0;
9631
9632
  if (w <= 0 || h <= 0) return;
9632
9633
  const fg = element.fillGradient;
9633
9634
  if (fg && isGradientConfig(fg)) {
@@ -19291,7 +19292,7 @@ const PageCanvas = react.forwardRef(
19291
19292
  }
19292
19293
  if (element.fillGradient && isGradientConfig(element.fillGradient)) {
19293
19294
  const objWidth = typeof obj.width === "number" ? obj.width : rW;
19294
- const objHeight = typeof obj.height === "number" ? obj.height : rH;
19295
+ const objHeight = isLine ? Math.max(typeof obj.height === "number" ? obj.height : 0, typeof element.strokeWidth === "number" ? element.strokeWidth : 0, 1) : typeof obj.height === "number" ? obj.height : rH;
19295
19296
  if (objWidth > 0 && objHeight > 0) {
19296
19297
  obj.set({
19297
19298
  fill: gradientToFabric(element.fillGradient, objWidth, objHeight),
@@ -19307,7 +19308,7 @@ const PageCanvas = react.forwardRef(
19307
19308
  }
19308
19309
  if (element.strokeGradient && isGradientConfig(element.strokeGradient)) {
19309
19310
  const objWidth = typeof obj.width === "number" ? obj.width : rW;
19310
- const objHeight = typeof obj.height === "number" ? obj.height : rH;
19311
+ const objHeight = isLine ? Math.max(typeof obj.height === "number" ? obj.height : 0, typeof element.strokeWidth === "number" ? element.strokeWidth : 0, 1) : typeof obj.height === "number" ? obj.height : rH;
19311
19312
  if (objWidth > 0 && objHeight > 0) {
19312
19313
  obj.set({
19313
19314
  stroke: gradientToFabric(element.strokeGradient, objWidth, objHeight),
@@ -26326,9 +26327,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
26326
26327
  }
26327
26328
  return svgString;
26328
26329
  }
26329
- const resolvedPackageVersion = "0.5.471";
26330
+ const resolvedPackageVersion = "0.5.473";
26330
26331
  const PACKAGE_VERSION = resolvedPackageVersion;
26331
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.471";
26332
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.473";
26332
26333
  const roundParityValue = (value) => {
26333
26334
  if (typeof value !== "number") return value;
26334
26335
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -27142,7 +27143,7 @@ class PixldocsRenderer {
27142
27143
  await this.waitForCanvasScene(container, cloned, i);
27143
27144
  }
27144
27145
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
27145
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CWW54LRg.cjs"));
27146
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DMy-gCf7.cjs"));
27146
27147
  const prepared = preparePagesForExport(
27147
27148
  cloned.pages,
27148
27149
  canvasWidth,
@@ -29462,7 +29463,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
29462
29463
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
29463
29464
  sanitizeSvgTreeForPdf(svgToDraw);
29464
29465
  try {
29465
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CWW54LRg.cjs"));
29466
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DMy-gCf7.cjs"));
29466
29467
  try {
29467
29468
  await logTextMeasurementDiagnostic(svgToDraw);
29468
29469
  } catch {
@@ -29776,4 +29777,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
29776
29777
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
29777
29778
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
29778
29779
  exports.warmTemplateFromForm = warmTemplateFromForm;
29779
- //# sourceMappingURL=index-Bj897CTu.cjs.map
29780
+ //# sourceMappingURL=index-ruS86aJe.cjs.map