Cursor centering fix

This commit is contained in:
Maciej Suminski
2016-08-11 14:42:14 +02:00
parent 2b041425e5
commit e452992a6c
2 changed files with 18 additions and 4 deletions
+8 -2
View File
@@ -298,8 +298,14 @@ void CURSOR::Plot( wxDC& aDC, mpWindow& aWindow )
wxQueueEvent( aWindow.GetParent(), new wxCommandEvent( EVT_SIM_CURSOR_UPDATE ) );
}
else
{
m_updateRef = true;
}
if( m_updateRef )
{
UpdateReference();
m_updateRef = false;
}
// Line length in horizontal and vertical dimensions
@@ -548,8 +554,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 ) );
int plotCenter = GetMarginLeft() + ( GetXScreen() - GetMarginLeft() - GetMarginRight() ) / 2;
c->SetX( plotCenter );
t->SetCursor( c );
AddLayer( c );
}