mirror of https://codeberg.org/topola/topola.git
contracts: Fix R-tree envelope invariance test
Violations were not detected if shape changed but not the envelope (which is the case when bends are flipped).
This commit is contained in:
parent
12e37e0e91
commit
abf92c7f43
|
|
@ -316,10 +316,13 @@ impl Layout {
|
|||
impl Layout {
|
||||
fn test_envelopes(&self) -> bool {
|
||||
!self.rtree.iter().any(|wrapper| {
|
||||
let index = wrapper.data;
|
||||
let shape = untag!(index, Primitive::new(index, &self.graph).shape());
|
||||
let wrapper = RTreeWrapper::new(shape, index);
|
||||
!self
|
||||
.rtree
|
||||
.locate_in_envelope(&wrapper.geom().envelope())
|
||||
.any(|w| w == wrapper)
|
||||
.locate_in_envelope(&shape.envelope())
|
||||
.any(|w| *w == wrapper)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ impl BendShape {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, EnumAsInner, PartialEq)]
|
||||
#[derive(Debug, Clone, Copy, EnumAsInner, PartialEq)]
|
||||
pub enum Shape {
|
||||
// Intentionally in different order to reorder `self.intersects(...)` properly.
|
||||
Dot(DotShape),
|
||||
|
|
|
|||
Loading…
Reference in New Issue