New cursor shows up in the center, can be dragged by its axis
This commit is contained in:
parent
2f8f92cf0a
commit
5772938a71
|
@ -195,6 +195,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void CURSOR::Plot( wxDC& aDC, mpWindow& aWindow )
|
void CURSOR::Plot( wxDC& aDC, mpWindow& aWindow )
|
||||||
{
|
{
|
||||||
if( !m_window )
|
if( !m_window )
|
||||||
|
@ -274,7 +275,7 @@ bool CURSOR::Inside( wxPoint& aPoint )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return ( std::abs( aPoint.x - m_window->x2p( m_trace->x2s( m_coords.x ) ) ) <= DRAG_MARGIN )
|
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 )
|
if( aEnable )
|
||||||
{
|
{
|
||||||
CURSOR* c = new CURSOR( t );
|
CURSOR* c = new CURSOR( t );
|
||||||
|
int plotCenter = GetMarginLeft() + ( GetXScreen() - GetMarginLeft() - GetMarginRight() ) / 2;
|
||||||
|
c->Move( wxPoint( plotCenter, 0 ) );
|
||||||
t->SetCursor( c );
|
t->SetCursor( c );
|
||||||
AddLayer( c );
|
AddLayer( c );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue