diff --git a/eeschema/sim/legacy_workbook.cpp b/eeschema/sim/legacy_workbook.cpp index cd026dd2cb..7febc6d875 100644 --- a/eeschema/sim/legacy_workbook.cpp +++ b/eeschema/sim/legacy_workbook.cpp @@ -44,7 +44,6 @@ void SIMULATOR_FRAME_UI::parseTraceParams( SIM_PLOT_TAB* aPlotTab, TRACE* aTrace CURSOR* cursor = new CURSOR( aTrace, aPlotTab ); cursor->SetName( aSignalName ); - cursor->SetPen( wxPen( aTrace->GetTraceColour() ) ); cursor->SetCoordX( x ); aTrace->SetCursor( aCursorId, cursor ); diff --git a/eeschema/sim/sim_plot_tab.cpp b/eeschema/sim/sim_plot_tab.cpp index 389c9e37cb..933c92285a 100644 --- a/eeschema/sim/sim_plot_tab.cpp +++ b/eeschema/sim/sim_plot_tab.cpp @@ -365,9 +365,14 @@ void CURSOR::Plot( wxDC& aDC, mpWindow& aWindow ) wxCoord bottomPx = aWindow.GetScrY() - aWindow.GetMarginBottom(); wxPen pen = GetPen(); - wxColour fg = GetPen().GetColour(); + wxColour fg = aWindow.GetForegroundColour(); + COLOR4D cursorColor = COLOR4D( m_trace->GetTraceColour() ).Mix( fg, 0.6 ); + COLOR4D textColor = fg; - pen.SetColour( COLOR4D( m_trace->GetTraceColour() ).Mix( fg, 0.6 ).ToColour() ); + if( cursorColor.Distance( textColor ) < 0.66 ) + textColor.Invert(); + + pen.SetColour( cursorColor.ToColour() ); pen.SetStyle( m_continuous ? wxPENSTYLE_SOLID : wxPENSTYLE_LONG_DASH ); aDC.SetPen( pen ); @@ -401,7 +406,7 @@ void CURSOR::Plot( wxDC& aDC, mpWindow& aWindow ) aDC.SetBrush( brush ); aDC.DrawPolygon( 3, poly ); - aDC.SetTextForeground( fg ); + aDC.SetTextForeground( textColor.ToColour() ); aDC.DrawLabel( id, textRect, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL ); } } diff --git a/eeschema/sim/simulator_frame_ui.cpp b/eeschema/sim/simulator_frame_ui.cpp index 69a33c3930..6ad2eca123 100644 --- a/eeschema/sim/simulator_frame_ui.cpp +++ b/eeschema/sim/simulator_frame_ui.cpp @@ -834,12 +834,14 @@ void SIMULATOR_FRAME_UI::rebuildSignalsGrid( wxString aFilter ) attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); m_signalsGrid->SetAttr( row, COL_CURSOR_1, attr ); + m_signalsGrid->SetCellValue( row, COL_CURSOR_1, trace->GetCursor( 1 ) ? "1" : "0" ); attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); attr->SetReadOnly(); // not really; we delegate interactivity to GRID_TRICKS attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); m_signalsGrid->SetAttr( row, COL_CURSOR_2, attr ); + m_signalsGrid->SetCellValue( row, COL_CURSOR_2, trace->GetCursor( 2 ) ? "1" : "0" ); } row++; @@ -2051,7 +2053,6 @@ bool SIMULATOR_FRAME_UI::loadJsonWorkbook( const wxString& aPath ) CURSOR* cursor = new CURSOR( aTrace, aPlotTab ); cursor->SetName( aSignalName ); - cursor->SetPen( wxPen( aTrace->GetTraceColour() ) ); cursor->SetCoordX( aCursor_js[ "position" ] ); aTrace->SetCursor( aCursorId, cursor );