From 0e263ff4d87765036da3a4e01ff56b2efe1600c2 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 10 Aug 2025 15:33:50 +0200 Subject: [PATCH] Implemented solution for #2110 (small cells and ghost cells) The solution consists of a second path to bounding boxes of cells - namely "bbox_with_empty". This bounding box is a (0,0;0,0)-box if the cell is empty. Correspondingly, empty and ghost cells are displayed as single points. Ghost cells also behave like hidden cells now. --- src/laybasic/laybasic/layFinder.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/laybasic/laybasic/layFinder.cc b/src/laybasic/laybasic/layFinder.cc index 6d187ea67..69d54f08d 100644 --- a/src/laybasic/laybasic/layFinder.cc +++ b/src/laybasic/laybasic/layFinder.cc @@ -837,9 +837,10 @@ InstFinder::visit_cell (const db::Cell &cell, const db::Box &search_box, const d ++*mp_progress; db::Box ibox; - if (inst_cell.bbox_with_empty ().empty ()) { - ibox = db::Box (db::Point (0, 0), db::Point (0, 0)); - } else if (! m_visible_layers || level == mp_view->get_max_hier_levels () - 1 || inst_cell.is_ghost_cell () || mp_view->is_cell_hidden (inst_cell.cell_index (), m_cv_index)) { + if (! m_visible_layers || level == mp_view->get_max_hier_levels () - 1 || inst_cell.is_ghost_cell () || mp_view->is_cell_hidden (inst_cell.cell_index (), m_cv_index)) { + ibox = inst_cell.bbox_with_empty (); + } else if (inst_cell.bbox ().empty ()) { + // empty cells cannot be found by visible layers, so we always select them here ibox = inst_cell.bbox_with_empty (); } else { for (std::vector::const_iterator l = m_visible_layer_indexes.begin (); l != m_visible_layer_indexes.end (); ++l) { @@ -915,9 +916,10 @@ InstFinder::visit_cell (const db::Cell &cell, const db::Box &search_box, const d double d = std::numeric_limits::max (); db::Box ibox; - if (inst_cell.bbox_with_empty ().empty ()) { - ibox = db::Box (db::Point (0, 0), db::Point (0, 0)); - } else if (! m_visible_layers || level == mp_view->get_max_hier_levels () - 1 || inst_cell.is_ghost_cell () || mp_view->is_cell_hidden (inst_cell.cell_index (), m_cv_index)) { + if (! m_visible_layers || level == mp_view->get_max_hier_levels () - 1 || inst_cell.is_ghost_cell () || mp_view->is_cell_hidden (inst_cell.cell_index (), m_cv_index)) { + ibox = inst_cell.bbox_with_empty (); + } else if (inst_cell.bbox ().empty ()) { + // empty cells cannot be found by visible layers, so we always select them here ibox = inst_cell.bbox_with_empty (); } else { for (std::vector::const_iterator l = m_visible_layer_indexes.begin (); l != m_visible_layer_indexes.end (); ++l) {