Fix formatting from simulator X/Y zoom changes

This commit is contained in:
ecorm 2024-01-29 23:59:12 -04:00 committed by Jeff Young
parent 16de0a666c
commit 4dcd1fb8e2
6 changed files with 84 additions and 98 deletions

View File

@ -1366,15 +1366,14 @@ EVT_MENU( mpID_ZOOM_UNDO, mpWindow::onZoomUndo )
EVT_MENU( mpID_ZOOM_REDO, mpWindow::onZoomRedo )
END_EVENT_TABLE()
mpWindow::mpWindow() :
mpWindow( DelegatingContructorTag() )
mpWindow::mpWindow() : mpWindow( DelegatingContructorTag() )
{
initializeGraphicsContext();
}
mpWindow::mpWindow( wxWindow* parent, wxWindowID id ) :
mpWindow( DelegatingContructorTag(),
parent, id, wxDefaultPosition, wxDefaultSize, 0, wxT( "mathplot" ) )
mpWindow( DelegatingContructorTag(), parent, id, wxDefaultPosition, wxDefaultSize, 0,
wxT( "mathplot" ) )
{
m_popmenu.Append( mpID_ZOOM_UNDO, _( "Undo Last Zoom" ), _( "Return zoom to level prior to last zoom action" ) );
m_popmenu.Append( mpID_ZOOM_REDO, _( "Redo Last Zoom" ), _( "Return zoom to level prior to last zoom undo" ) );
@ -1618,9 +1617,8 @@ void mpWindow::Fit()
// JL
void mpWindow::Fit( double xMin, double xMax, double yMin, double yMax,
const wxCoord* printSizeX, const wxCoord* printSizeY,
wxOrientation directions )
void mpWindow::Fit( double xMin, double xMax, double yMin, double yMax, const wxCoord* printSizeX,
const wxCoord* printSizeY, wxOrientation directions )
{
const bool isPrinting = printSizeX != nullptr && printSizeY != nullptr;
@ -1798,8 +1796,7 @@ void mpWindow::ZoomOut( const wxPoint& centerPoint )
}
void mpWindow::ZoomOut( const wxPoint& centerPoint, double zoomFactor,
wxOrientation directions )
void mpWindow::ZoomOut( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions )
{
if( zoomFactor == 0 )
zoomFactor = 1.0;
@ -2082,8 +2079,7 @@ void mpWindow::OnPaint( wxPaintEvent& WXUNUSED( event ) )
paintDC.Blit( 0, 0, m_scrX, m_scrY, targetDC, 0, 0 );
}
void mpWindow::DoZoom( const wxPoint& centerPoint, double zoomFactor,
wxOrientation directions )
void mpWindow::DoZoom( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions )
{
if( m_yLocked )
{
@ -2225,8 +2221,7 @@ void mpWindow::PerformMouseWheelAction( wxMouseEvent& event, MouseWheelAction ac
switch( action )
{
case MouseWheelAction::NONE:
break;
case MouseWheelAction::NONE: break;
case MouseWheelAction::PAN_LEFT_RIGHT:
SetXView( m_posX + changeUnitsX, m_desiredXmax + changeUnitsX,
@ -2270,8 +2265,7 @@ void mpWindow::PerformMouseWheelAction( wxMouseEvent& event, MouseWheelAction ac
ZoomOut( clickPt, zoomIncrementalFactor, wxVERTICAL );
break;
default:
break;
default: break;
}
}

View File

@ -551,37 +551,31 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>(
"simulator.mouse_wheel_actions.vertical_unmodified",
&m_Simulator.preferences.mouse_wheel_actions.vertical_unmodified,
SIM_MOUSE_WHEEL_ACTION::ZOOM,
SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::ZOOM, SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>(
"simulator.mouse_wheel_actions.vertical_with_ctrl",
&m_Simulator.preferences.mouse_wheel_actions.vertical_with_ctrl,
SIM_MOUSE_WHEEL_ACTION::PAN_LEFT_RIGHT,
SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::PAN_LEFT_RIGHT, SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>(
"simulator.mouse_wheel_actions.vertical_with_shift",
&m_Simulator.preferences.mouse_wheel_actions.vertical_with_shift,
SIM_MOUSE_WHEEL_ACTION::PAN_UP_DOWN,
SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::PAN_UP_DOWN, SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>(
"simulator.mouse_wheel_actions.vertical_with_alt",
&m_Simulator.preferences.mouse_wheel_actions.vertical_with_alt,
SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::NONE, SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>(
"simulator.mouse_wheel_actions.horizontal",
&m_Simulator.preferences.mouse_wheel_actions.horizontal,
SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY) );
&m_Simulator.preferences.mouse_wheel_actions.horizontal, SIM_MOUSE_WHEEL_ACTION::NONE,
SIM_MOUSE_WHEEL_ACTION::NONE, SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
m_params.emplace_back( new PARAM<int>( "symbol_chooser.sash_pos_h",
&m_SymChooserPanel.sash_pos_h, -1 ) );

View File

@ -197,8 +197,7 @@ public:
void ApplyPreferences( const SIM_PREFERENCES& aPrefs ) override
{
m_plotWin->SetMouseWheelActions(
convertMouseWheelActions( aPrefs.mouse_wheel_actions ) );
m_plotWin->SetMouseWheelActions( convertMouseWheelActions( aPrefs.mouse_wheel_actions ) );
}
wxString GetLabelX() const
@ -368,8 +367,8 @@ private:
static mpWindow::MouseWheelActionSet
convertMouseWheelActions( const SIM_MOUSE_WHEEL_ACTION_SET& s )
{
static_assert( static_cast<unsigned>(mpWindow::MouseWheelAction::COUNT) ==
static_cast<unsigned>(SIM_MOUSE_WHEEL_ACTION::COUNT),
static_assert( static_cast<unsigned>( mpWindow::MouseWheelAction::COUNT )
== static_cast<unsigned>( SIM_MOUSE_WHEEL_ACTION::COUNT ),
"mpWindow::MouseWheelAction enum must match SIM_MOUSE_WHEEL_ACTION" );
using A = mpWindow::MouseWheelAction;

View File

@ -1124,8 +1124,7 @@ public:
* position on the screen after the zoom (by default, the center of the mpWindow).
*/
void ZoomIn( const wxPoint& centerPoint = wxDefaultPosition );
void ZoomIn( const wxPoint& centerPoint, double zoomFactor,
wxOrientation directions = wxBOTH );
void ZoomIn( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions = wxBOTH );
/** Zoom out current view and refresh display
* @param centerPoint The point (pixel coordinates) that will stay in the same