layout: access shape via layout instead of getting it from a cache

This commit is contained in:
Mikolaj Wielgus 2024-03-14 13:59:22 +00:00
parent 93381f39fb
commit 6965177e78
1 changed files with 2 additions and 2 deletions

View File

@ -735,7 +735,7 @@ impl<R: RulesTrait> Layout<R> {
.clamp(0.0, f64::INFINITY),
);
inflated_shape.intersects(wrapper.geom())
inflated_shape.intersects(&wrapper.data.primitive(self).shape())
})
.map(|wrapper| wrapper.data)
.next()
@ -751,7 +751,7 @@ impl<R: RulesTrait> Layout<R> {
.rtree()
.locate_in_envelope_intersecting(&RTreeObject::envelope(&shape))
.filter(|wrapper| !self.are_connectable(node, wrapper.data))
.filter(|wrapper| shape.intersects(wrapper.geom()))
.filter(|wrapper| shape.intersects(&wrapper.data.primitive(self).shape()))
.map(|wrapper| wrapper.data)
.next()
.and_then(|collidee| Some(Collision(shape, collidee)))