From c5da9c717d6ce9c5197b973462f6289ba43ef6a8 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 18 Feb 2022 18:49:00 +0100 Subject: [PATCH] scale_and_snap: separate handling of shapes with properties and without --- src/db/db/dbLayoutUtils.cc | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/db/db/dbLayoutUtils.cc b/src/db/db/dbLayoutUtils.cc index 319a878d9..82ead48ce 100644 --- a/src/db/db/dbLayoutUtils.cc +++ b/src/db/db/dbLayoutUtils.cc @@ -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); + } }