Move cross-probe scrolling to FocusOnLocation.

It handles not moving the display too much and using the exposed
center if there is a dialog over the window.

Fixes https://gitlab.com/kicad/code/kicad/issues/8985
This commit is contained in:
Jeff Young 2021-09-26 20:05:58 +01:00
parent a3dcdd4887
commit 422def1261
3 changed files with 3 additions and 3 deletions

View File

@ -406,7 +406,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
#endif // ifndef DEFAULT_PCBNEW_CODE #endif // ifndef DEFAULT_PCBNEW_CODE
} }
view->SetCenter( bbox.Centre() ); FocusOnLocation( (wxPoint) bbox.Centre() );
} }
view->UpdateAllLayersColor(); view->UpdateAllLayersColor();

View File

@ -73,7 +73,7 @@ PANEL_DISPLAY_OPTIONS_BASE::PANEL_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWind
wxStaticBoxSizer* sbSizer3; wxStaticBoxSizer* sbSizer3;
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( pcbPage, wxID_ANY, _("Cross-probing") ), wxVERTICAL ); sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( pcbPage, wxID_ANY, _("Cross-probing") ), wxVERTICAL );
m_checkCrossProbeCenter = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Center view on cross-probed items"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkCrossProbeCenter = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Scroll cross-probed items into view"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkCrossProbeCenter->SetValue(true); m_checkCrossProbeCenter->SetValue(true);
sbSizer3->Add( m_checkCrossProbeCenter, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizer3->Add( m_checkCrossProbeCenter, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );

View File

@ -641,7 +641,7 @@
<property name="gripper">0</property> <property name="gripper">0</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Center view on cross-probed items</property> <property name="label">Scroll cross-probed items into view</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>