@pixldocs/canvas-renderer 0.5.431 → 0.5.432

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.
@@ -13987,10 +13987,32 @@ const PageCanvas = react.forwardRef(
13987
13987
  if (!isGroup(node)) continue;
13988
13988
  if (node.backgroundColor) continue;
13989
13989
  if (activeEditingGroupId && node.id === activeEditingGroupId) continue;
13990
- const b = groupFabricUnionBBox(node);
13991
- if (!b) continue;
13992
- if (px < b.left || py < b.top || px > b.right || py > b.bottom) continue;
13993
- const area = Math.max(1, (b.right - b.left) * (b.bottom - b.top));
13990
+ const oriented = groupFabricOrientedBBox(node);
13991
+ let inside = false;
13992
+ let area = 0;
13993
+ if (oriented && Math.abs(oriented.angle) > 0.01) {
13994
+ const rad = -oriented.angle * Math.PI / 180;
13995
+ const cos = Math.cos(rad), sin = Math.sin(rad);
13996
+ let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
13997
+ for (const p of oriented.corners) {
13998
+ const xr2 = p.x * cos - p.y * sin;
13999
+ const yr2 = p.x * sin + p.y * cos;
14000
+ if (xr2 < minX) minX = xr2;
14001
+ if (yr2 < minY) minY = yr2;
14002
+ if (xr2 > maxX) maxX = xr2;
14003
+ if (yr2 > maxY) maxY = yr2;
14004
+ }
14005
+ const xr = px * cos - py * sin;
14006
+ const yr = px * sin + py * cos;
14007
+ inside = xr >= minX && xr <= maxX && yr >= minY && yr <= maxY;
14008
+ area = Math.max(1, (maxX - minX) * (maxY - minY));
14009
+ } else {
14010
+ const b = groupFabricUnionBBox(node);
14011
+ if (!b) continue;
14012
+ inside = !(px < b.left || py < b.top || px > b.right || py > b.bottom);
14013
+ area = Math.max(1, (b.right - b.left) * (b.bottom - b.top));
14014
+ }
14015
+ if (!inside) continue;
13994
14016
  if (!pick || area < pick.area) pick = { group: node, area };
13995
14017
  }
13996
14018
  return pick;
@@ -25758,9 +25780,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
25758
25780
  }
25759
25781
  return svgString;
25760
25782
  }
25761
- const resolvedPackageVersion = "0.5.431";
25783
+ const resolvedPackageVersion = "0.5.432";
25762
25784
  const PACKAGE_VERSION = resolvedPackageVersion;
25763
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.431";
25785
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.432";
25764
25786
  const roundParityValue = (value) => {
25765
25787
  if (typeof value !== "number") return value;
25766
25788
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -26574,7 +26596,7 @@ class PixldocsRenderer {
26574
26596
  await this.waitForCanvasScene(container, cloned, i);
26575
26597
  }
26576
26598
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
26577
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-zM3-7B0b.cjs"));
26599
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-DgXV6S2u.cjs"));
26578
26600
  const prepared = preparePagesForExport(
26579
26601
  cloned.pages,
26580
26602
  canvasWidth,
@@ -28894,7 +28916,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
28894
28916
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
28895
28917
  sanitizeSvgTreeForPdf(svgToDraw);
28896
28918
  try {
28897
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-zM3-7B0b.cjs"));
28919
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-DgXV6S2u.cjs"));
28898
28920
  try {
28899
28921
  await logTextMeasurementDiagnostic(svgToDraw);
28900
28922
  } catch {
@@ -29291,4 +29313,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
29291
29313
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
29292
29314
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
29293
29315
  exports.warmTemplateFromForm = warmTemplateFromForm;
29294
- //# sourceMappingURL=index-Ce2dA8D0.cjs.map
29316
+ //# sourceMappingURL=index-CK9heNqN.cjs.map