scale_and_snap: separate handling of shapes with properties and without

This commit is contained in:
Matthias Koefferlein 2022-02-18 18:49:00 +01:00
parent a133a8f43b
commit c5da9c717d
1 changed files with 25 additions and 5 deletions

View File

@ -531,9 +531,17 @@ scale_and_snap (db::Layout &layout, db::Cell &cell, db::Coord g, db::Coord m, db
poly.transform (trinv);
if (si->is_box () && poly.is_box ()) {
new_shapes.insert (db::BoxWithProperties (poly.box (), si->prop_id ()));
if (si->has_prop_id ()) {
new_shapes.insert (db::BoxWithProperties (poly.box (), si->prop_id ()));
} else {
new_shapes.insert (poly.box ());
}
} else {
new_shapes.insert (db::PolygonWithProperties (poly, si->prop_id ()));
if (si->has_prop_id ()) {
new_shapes.insert (db::PolygonWithProperties (poly, si->prop_id ()));
} else {
new_shapes.insert (poly);
}
}
}
@ -546,7 +554,11 @@ scale_and_snap (db::Layout &layout, db::Cell &cell, db::Coord g, db::Coord m, db
text.trans (db::Trans (text.trans ().rot (), scaled_and_snapped_vector (text.trans ().disp (), g, m, d, tr_disp.x (), g, m, d, tr_disp.y ())));
text.transform (trinv);
new_shapes.insert (db::TextWithProperties (text, si->prop_id ()));
if (si->has_prop_id ()) {
new_shapes.insert (db::TextWithProperties (text, si->prop_id ()));
} else {
new_shapes.insert (text);
}
}
@ -558,7 +570,11 @@ scale_and_snap (db::Layout &layout, db::Cell &cell, db::Coord g, db::Coord m, db
edge = scaled_and_snapped_edge (edge, g, m , d, tr_disp.x (), tr_disp.y ());
edge.transform (trinv);
new_shapes.insert (db::EdgeWithProperties (edge, si->prop_id ()));
if (si->has_prop_id ()) {
new_shapes.insert (db::EdgeWithProperties (edge, si->prop_id ()));
} else {
new_shapes.insert (edge);
}
}
@ -571,7 +587,11 @@ scale_and_snap (db::Layout &layout, db::Cell &cell, db::Coord g, db::Coord m, db
scaled_and_snapped_edge (edge_pair.second (), g, m , d, tr_disp.x (), tr_disp.y ()));
edge_pair.transform (trinv);
new_shapes.insert (db::EdgePairWithProperties (edge_pair, si->prop_id ()));
if (si->has_prop_id ()) {
new_shapes.insert (db::EdgePairWithProperties (edge_pair, si->prop_id ()));
} else {
new_shapes.insert (edge_pair);
}
}