Fix some contrast and update issues with sim cursors.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18390
This commit is contained in:
Jeff Young
2024-08-15 12:29:59 -06:00
parent 15d266f9a8
commit e3d4137521
3 changed files with 10 additions and 5 deletions
+8 -3
View File
@@ -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 );
}
}