mirror of https://github.com/KLayout/klayout.git
Enabled 'break_polygons' for editable Shapes containers
This commit is contained in:
parent
1ed69e9b46
commit
4d80fb37c3
|
|
@ -715,6 +715,8 @@ static bool split_polygon (bool first, db::Polygon &poly, size_t max_vertex_coun
|
||||||
void
|
void
|
||||||
break_polygons (db::Shapes &shapes, size_t max_vertex_count, double max_area_ratio)
|
break_polygons (db::Shapes &shapes, size_t max_vertex_count, double max_area_ratio)
|
||||||
{
|
{
|
||||||
|
if (shapes.is_editable ()) {
|
||||||
|
|
||||||
std::vector<db::Polygon> new_polygons;
|
std::vector<db::Polygon> new_polygons;
|
||||||
std::vector<db::Shape> to_delete;
|
std::vector<db::Shape> to_delete;
|
||||||
|
|
||||||
|
|
@ -731,6 +733,18 @@ break_polygons (db::Shapes &shapes, size_t max_vertex_count, double max_area_rat
|
||||||
for (auto p = new_polygons.begin (); p != new_polygons.end (); ++p) {
|
for (auto p = new_polygons.begin (); p != new_polygons.end (); ++p) {
|
||||||
shapes.insert (*p);
|
shapes.insert (*p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// In non-editable mode we cannot do "erase", so we use a temporary, editable Shapes container
|
||||||
|
db::Shapes tmp (true);
|
||||||
|
tmp.insert (shapes);
|
||||||
|
|
||||||
|
shapes.clear ();
|
||||||
|
break_polygons (tmp, max_vertex_count, max_area_ratio);
|
||||||
|
shapes.insert (tmp);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue