| 6259 | } |
| 6260 | |
| 6261 | db::InstElement |
| 6262 | LayoutViewBase::ascend (int index) |
| 6263 | { |
| 6264 | tl_assert (int (m_cellviews.size ()) > index && cellview_iter (index)->is_valid ()); |
| 6265 | |
| 6266 | lay::CellView &cv = *cellview_iter (index); |
| 6267 | |
| 6268 | cellview_about_to_change_event (index); |
| 6269 | |
| 6270 | lay::CellView::specific_cell_path_type spath (cv.specific_path ()); |
| 6271 | if (spath.empty ()) { |
| 6272 | |
| 6273 | lay::CellView::unspecific_cell_path_type upath (cv.unspecific_path ()); |
| 6274 | if (upath.size () >= 2) { |
| 6275 | |
| 6276 | db::cell_index_type last = upath.back (); |
| 6277 | upath.pop_back (); |
| 6278 | const db::Cell &new_cell = cv->layout ().cell (upath.back ()); |
| 6279 | |
| 6280 | auto i = new_cell.begin (); |
| 6281 | while (! i.at_end () && i->cell_index () != last) { |
| 6282 | ++i; |
| 6283 | } |
| 6284 | |
| 6285 | if (! i.at_end ()) { |
| 6286 | select_cell_dispatch (upath, index); |
| 6287 | return db::InstElement (*i); |
| 6288 | } |
| 6289 | |
| 6290 | } |
| 6291 | |
| 6292 | return db::InstElement (); |
| 6293 | |
| 6294 | } else { |
| 6295 | |
| 6296 | cancel (); |
| 6297 | db::InstElement ret = spath.back (); |
| 6298 | spath.pop_back (); |
| 6299 | cv.set_specific_path (spath); |
| 6300 | |
| 6301 | store_state (); |
| 6302 | redraw (); |
| 6303 | |
| 6304 | cellview_changed (index); |
| 6305 | |
| 6306 | update_content (); |
| 6307 | |
| 6308 | return ret; |
| 6309 | |
| 6310 | } |
| 6311 | } |
| 6312 | |
| 6313 | void |
| 6314 | LayoutViewBase::descend (const std::vector<db::InstElement> &path, int index) |