diff --git a/src/edt/edt/edtPartialService.cc b/src/edt/edt/edtPartialService.cc index a527ea03c..18b5e98ad 100644 --- a/src/edt/edt/edtPartialService.cc +++ b/src/edt/edt/edtPartialService.cc @@ -2700,7 +2700,26 @@ PartialService::partial_select (const db::DBox &box, lay::Editable::SelectionMod } else { - PartialShapeFinder finder (box.is_point (), m_top_level_sel, db::ShapeIterator::All); + int shape_flags = 0; + if (edt::polygons_enabled ()) { + shape_flags |= db::ShapeIterator::Polygons; + } + if (edt::paths_enabled ()) { + // Note: points, edges and edge pairs don't have seperate entires, so + // we count them as paths here + shape_flags |= db::ShapeIterator::Paths; + shape_flags |= db::ShapeIterator::Edges; + shape_flags |= db::ShapeIterator::EdgePairs; + shape_flags |= db::ShapeIterator::Points; + } + if (edt::boxes_enabled ()) { + shape_flags |= db::ShapeIterator::Boxes; + } + if (edt::texts_enabled ()) { + shape_flags |= db::ShapeIterator::Texts; + } + + PartialShapeFinder finder (box.is_point (), m_top_level_sel, db::ShapeIterator::flags_type (shape_flags)); finder.find (view (), search_box); // We must make sure that guiding shapes are only selected alone. The first selected object will @@ -2750,7 +2769,7 @@ PartialService::partial_select (const db::DBox &box, lay::Editable::SelectionMod } // check, if there is a selected instance inside the box - in this case, we do not do a new selection - if (! box.is_point ()) { + if (! box.is_point () && edt::instances_enabled ()) { lay::InstFinder inst_finder (box.is_point (), m_top_level_sel, true /*full arrays*/, true /*enclose*/, 0 /*no excludes*/, true /*visible layers*/); inst_finder.find (view (), search_box); diff --git a/src/edt/edt/edtPlugin.cc b/src/edt/edt/edtPlugin.cc index daf89efe6..51eea026b 100644 --- a/src/edt/edt/edtPlugin.cc +++ b/src/edt/edt/edtPlugin.cc @@ -287,6 +287,24 @@ static tl::RegisteredClass config_decl5 ( "edt::Service(CellInstances)" ); +template +bool is_enabled () +{ + for (auto p = tl::Registrar::begin (); p != tl::Registrar::end (); ++p) { + auto pd = dynamic_cast *> (p.operator-> ()); + if (pd) { + return pd->editable_enabled (); + } + } + return false; +} + +bool polygons_enabled () { return is_enabled (); } +bool paths_enabled () { return is_enabled (); } +bool boxes_enabled () { return is_enabled (); } +bool texts_enabled () { return is_enabled (); } +bool instances_enabled () { return is_enabled (); } + class MainPluginDeclaration : public lay::PluginDeclaration { diff --git a/src/edt/edt/edtPlugin.h b/src/edt/edt/edtPlugin.h index 3076fcd78..dc9bef133 100644 --- a/src/edt/edt/edtPlugin.h +++ b/src/edt/edt/edtPlugin.h @@ -46,6 +46,17 @@ namespace edt // .. nothing yet .. }; + /** + * @brief Returns a value indicating whether polygons are enabled in the "Select" menu + */ + bool polygons_enabled (); + + // other types ... + bool paths_enabled (); + bool boxes_enabled (); + bool texts_enabled (); + bool instances_enabled (); + /** * @brief Commits the current configuration for the recently used configuration list */