stickyflow 0.9.0 → 0.9.1

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.
@@ -9578,15 +9578,30 @@ function applyFrameClips(nodes, frames) {
9578
9578
  }
9579
9579
 
9580
9580
  // src/renderScene/scene/build.ts
9581
+ function visibleBounds(node) {
9582
+ let { minX, minY, maxX, maxY } = node.bounds;
9583
+ let clip = "style" in node ? node.style?.clip : void 0;
9584
+ while (clip) {
9585
+ if (clip.type === "rect") {
9586
+ minX = Math.max(minX, clip.x);
9587
+ minY = Math.max(minY, clip.y);
9588
+ maxX = Math.min(maxX, clip.x + clip.width);
9589
+ maxY = Math.min(maxY, clip.y + clip.height);
9590
+ }
9591
+ clip = clip.within;
9592
+ }
9593
+ return minX <= maxX && minY <= maxY ? { minX, minY, maxX, maxY } : node.bounds;
9594
+ }
9581
9595
  function sceneBounds(nodes) {
9582
9596
  if (!nodes.length) {
9583
9597
  return EMPTY_BOUNDS;
9584
9598
  }
9599
+ const all = nodes.map(visibleBounds);
9585
9600
  return {
9586
- minX: Math.min(...nodes.map((n) => n.bounds.minX)),
9587
- minY: Math.min(...nodes.map((n) => n.bounds.minY)),
9588
- maxX: Math.max(...nodes.map((n) => n.bounds.maxX)),
9589
- maxY: Math.max(...nodes.map((n) => n.bounds.maxY))
9601
+ minX: Math.min(...all.map((b) => b.minX)),
9602
+ minY: Math.min(...all.map((b) => b.minY)),
9603
+ maxX: Math.max(...all.map((b) => b.maxX)),
9604
+ maxY: Math.max(...all.map((b) => b.maxY))
9590
9605
  };
9591
9606
  }
9592
9607
  function stackingOf(input) {
@@ -10325,5 +10340,5 @@ function defineComponent(definition) {
10325
10340
  }
10326
10341
 
10327
10342
  export { collectCanvasObjects, decodeColor, decodeShadow, defineComponent, render, renderCanvas, sflToRenderInput, sliderReach };
10328
- //# sourceMappingURL=chunk-FS6L462E.js.map
10329
- //# sourceMappingURL=chunk-FS6L462E.js.map
10343
+ //# sourceMappingURL=chunk-TH2HFMEL.js.map
10344
+ //# sourceMappingURL=chunk-TH2HFMEL.js.map