From 422def1261812ccedd18b0d5c0785fbcbbaacfb0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 26 Sep 2021 20:05:58 +0100 Subject: [PATCH] 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 --- pcbnew/cross-probing.cpp | 2 +- pcbnew/dialogs/panel_display_options_base.cpp | 2 +- pcbnew/dialogs/panel_display_options_base.fbp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index a80ee8b0f5..f11cb1c028 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -406,7 +406,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) #endif // ifndef DEFAULT_PCBNEW_CODE } - view->SetCenter( bbox.Centre() ); + FocusOnLocation( (wxPoint) bbox.Centre() ); } view->UpdateAllLayersColor(); diff --git a/pcbnew/dialogs/panel_display_options_base.cpp b/pcbnew/dialogs/panel_display_options_base.cpp index c4dccc2638..9d971993e5 100644 --- a/pcbnew/dialogs/panel_display_options_base.cpp +++ b/pcbnew/dialogs/panel_display_options_base.cpp @@ -73,7 +73,7 @@ PANEL_DISPLAY_OPTIONS_BASE::PANEL_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWind wxStaticBoxSizer* sbSizer3; 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); sbSizer3->Add( m_checkCrossProbeCenter, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); diff --git a/pcbnew/dialogs/panel_display_options_base.fbp b/pcbnew/dialogs/panel_display_options_base.fbp index da23326d2b..d7cf0af3f8 100644 --- a/pcbnew/dialogs/panel_display_options_base.fbp +++ b/pcbnew/dialogs/panel_display_options_base.fbp @@ -641,7 +641,7 @@ 0 0 wxID_ANY - Center view on cross-probed items + Scroll cross-probed items into view 0