From 5772938a71f7d3102fa708e3cd664549d43e8581 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 11 Aug 2016 14:42:07 +0200 Subject: [PATCH] New cursor shows up in the center, can be dragged by its axis --- eeschema/sim/sim_plot_panel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eeschema/sim/sim_plot_panel.cpp b/eeschema/sim/sim_plot_panel.cpp index 6d5bc8ff07..e6464e2b35 100644 --- a/eeschema/sim/sim_plot_panel.cpp +++ b/eeschema/sim/sim_plot_panel.cpp @@ -195,6 +195,7 @@ public: } }; + void CURSOR::Plot( wxDC& aDC, mpWindow& aWindow ) { if( !m_window ) @@ -274,7 +275,7 @@ bool CURSOR::Inside( wxPoint& aPoint ) return false; return ( std::abs( aPoint.x - m_window->x2p( m_trace->x2s( m_coords.x ) ) ) <= DRAG_MARGIN ) - && ( std::abs( aPoint.y - m_window->y2p( m_trace->y2s( m_coords.y ) ) ) <= DRAG_MARGIN ); + || ( std::abs( aPoint.y - m_window->y2p( m_trace->y2s( m_coords.y ) ) ) <= DRAG_MARGIN ); } @@ -495,6 +496,8 @@ void SIM_PLOT_PANEL::EnableCursor( const wxString& aName, bool aEnable ) if( aEnable ) { CURSOR* c = new CURSOR( t ); + int plotCenter = GetMarginLeft() + ( GetXScreen() - GetMarginLeft() - GetMarginRight() ) / 2; + c->Move( wxPoint( plotCenter, 0 ) ); t->SetCursor( c ); AddLayer( c ); }