Skip to content

Commit c7d1e8a

Browse files
committed
fix(zones): don't add ancestors of zone to be captured
1 parent a58ab46 commit c7d1e8a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/nodes/spatial/zone.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ impl Zone {
8080

8181
let current_zoneables = Registry::new();
8282
for zoneable in ZONEABLE_REGISTRY.get_valid_contents() {
83+
// Skip if the zoneable is an ancestor of the zone or the zone itself
84+
if zoneable.is_ancestor_of(self.spatial.clone()) {
85+
continue;
86+
}
87+
8388
let distance = self.field.distance(&zoneable, [0.0; 3].into());
8489
if distance > 0.0 {
8590
continue;

0 commit comments

Comments
 (0)