@@ -365,27 +365,31 @@ MainWindow::MainWindow(bool load_settings, QWidget* parent)
365365 connect (this , &MainWindow::blockLoaded, drc_viewer_, &DRCWidget::setBlock);
366366 connect (
367367 this , &MainWindow::blockLoaded, clock_viewer_, &ClockWidget::setBlock);
368- connect (drc_viewer_, &DRCWidget::selectDRC, [this ](const Selected& selected) {
369- setSelected (selected, false );
370- odb::Rect bbox;
371- selected.getBBox (bbox);
372-
373- auto * block = getBlock ();
374- int zoomout_dist = std::numeric_limits<int >::max ();
375- if (block != nullptr ) {
376- // 10 microns
377- zoomout_dist = 10 * block->getDbUnitsPerMicron ();
378- }
379- // twice the largest dimension of bounding box
380- const int zoomout_box = 2 * std::max (bbox.dx (), bbox.dy ());
381- // pick smallest
382- const int zoomout_margin = std::min (zoomout_dist, zoomout_box);
383- bbox.set_xlo (bbox.xMin () - zoomout_margin);
384- bbox.set_ylo (bbox.yMin () - zoomout_margin);
385- bbox.set_xhi (bbox.xMax () + zoomout_margin);
386- bbox.set_yhi (bbox.yMax () + zoomout_margin);
387- zoomTo (bbox);
388- });
368+ connect (drc_viewer_,
369+ &DRCWidget::selectDRC,
370+ [this ](const Selected& selected, const bool open_inspector) {
371+ if (open_inspector) {
372+ setSelected (selected, false );
373+ }
374+ odb::Rect bbox;
375+ selected.getBBox (bbox);
376+
377+ auto * block = getBlock ();
378+ int zoomout_dist = std::numeric_limits<int >::max ();
379+ if (block != nullptr ) {
380+ // 10 microns
381+ zoomout_dist = 10 * block->getDbUnitsPerMicron ();
382+ }
383+ // twice the largest dimension of bounding box
384+ const int zoomout_box = 2 * std::max (bbox.dx (), bbox.dy ());
385+ // pick smallest
386+ const int zoomout_margin = std::min (zoomout_dist, zoomout_box);
387+ bbox.set_xlo (bbox.xMin () - zoomout_margin);
388+ bbox.set_ylo (bbox.yMin () - zoomout_margin);
389+ bbox.set_xhi (bbox.xMax () + zoomout_margin);
390+ bbox.set_yhi (bbox.yMax () + zoomout_margin);
391+ zoomTo (bbox);
392+ });
389393 connect (this , &MainWindow::selectionChanged, [this ]() {
390394 if (!selected_.empty ()) {
391395 drc_viewer_->updateSelection (*selected_.begin ());
0 commit comments