mirror of https://github.com/KLayout/klayout.git
Fixed #909 (Crash on DRC)
This commit is contained in:
parent
eb8c7ff53f
commit
451f57bb25
|
|
@ -204,6 +204,16 @@ OriginalLayerRegion::count () const
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
|
|
||||||
|
} else if (! iter.layout ()) {
|
||||||
|
|
||||||
|
// for Shapes-based iterators just use the shape count
|
||||||
|
|
||||||
|
if (iter.shapes ()) {
|
||||||
|
return iter.shapes ()->size (iter.shape_flags () & db::ShapeIterator::Regions);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// otherwise we can utilize the CellCounter
|
// otherwise we can utilize the CellCounter
|
||||||
|
|
|
||||||
|
|
@ -2094,3 +2094,16 @@ TEST(issue_277)
|
||||||
r.set_min_coherence (false); // needs to merge again
|
r.set_min_coherence (false); // needs to merge again
|
||||||
EXPECT_EQ (r.sized (1).merged (false, 1).to_string (), "");
|
EXPECT_EQ (r.sized (1).merged (false, 1).to_string (), "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(issue_909)
|
||||||
|
{
|
||||||
|
db::Shapes s1;
|
||||||
|
s1.insert(db::Box(0, 0, 100, 100));
|
||||||
|
db::Shapes s2;
|
||||||
|
s2.insert(db::Box(0, 0, 200, 300));
|
||||||
|
db::Region r1 = db::Region (db::RecursiveShapeIterator (s1));
|
||||||
|
db::Region r2 = db::Region (db::RecursiveShapeIterator (s2));
|
||||||
|
|
||||||
|
db::Region r = r1 + r2;
|
||||||
|
EXPECT_EQ (r.to_string (), "(0,0;0,100;100,100;100,0);(0,0;0,300;200,300;200,0)");
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue