@pixldocs/canvas-renderer 0.5.389 → 0.5.390

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.
@@ -13522,13 +13522,19 @@ const PageCanvas = forwardRef(
13522
13522
  if (oid && memberIds.has(oid)) members.push(o);
13523
13523
  }
13524
13524
  if (members.length === 0) return null;
13525
- const a0 = ((members[0].angle ?? 0) % 360 + 360) % 360;
13526
13525
  const TOL = 0.5;
13526
+ const buckets = [];
13527
13527
  for (const m of members) {
13528
13528
  const a = ((m.angle ?? 0) % 360 + 360) % 360;
13529
- const diff = Math.min(Math.abs(a - a0), 360 - Math.abs(a - a0));
13530
- if (diff > TOL) return null;
13529
+ const b = buckets.find((x) => {
13530
+ const d = Math.min(Math.abs(x.angle - a), 360 - Math.abs(x.angle - a));
13531
+ return d <= TOL;
13532
+ });
13533
+ if (b) b.count++;
13534
+ else buckets.push({ angle: a, count: 1 });
13531
13535
  }
13536
+ buckets.sort((a, b) => b.count - a.count);
13537
+ const a0 = buckets[0].angle;
13532
13538
  const rad = -a0 * Math.PI / 180;
13533
13539
  const cos = Math.cos(rad), sin = Math.sin(rad);
13534
13540
  let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
@@ -25018,9 +25024,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25018
25024
  }
25019
25025
  return svgString;
25020
25026
  }
25021
- const resolvedPackageVersion = "0.5.389";
25027
+ const resolvedPackageVersion = "0.5.390";
25022
25028
  const PACKAGE_VERSION = resolvedPackageVersion;
25023
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.389";
25029
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.390";
25024
25030
  const roundParityValue = (value) => {
25025
25031
  if (typeof value !== "number") return value;
25026
25032
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -25834,7 +25840,7 @@ class PixldocsRenderer {
25834
25840
  await this.waitForCanvasScene(container, cloned, i);
25835
25841
  }
25836
25842
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
25837
- const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-aeROfqEB.js");
25843
+ const { exportMultiPagePdf, preparePagesForExport } = await import("./vectorPdfExport-p4K2EISX.js");
25838
25844
  const prepared = preparePagesForExport(
25839
25845
  cloned.pages,
25840
25846
  canvasWidth,
@@ -28154,7 +28160,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28154
28160
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28155
28161
  sanitizeSvgTreeForPdf(svgToDraw);
28156
28162
  try {
28157
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-aeROfqEB.js");
28163
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await import("./vectorPdfExport-p4K2EISX.js");
28158
28164
  try {
28159
28165
  await logTextMeasurementDiagnostic(svgToDraw);
28160
28166
  } catch {
@@ -28554,4 +28560,4 @@ export {
28554
28560
  buildTeaserBlurFlatKeys as y,
28555
28561
  collectFontDescriptorsFromConfig as z
28556
28562
  };
28557
- //# sourceMappingURL=index-CxeXN5KG.js.map
28563
+ //# sourceMappingURL=index-ByJXwd5Y.js.map