Switch selection color to platform selection color.

This commit is contained in:
Jeff Young 2019-07-31 22:52:22 -06:00
parent 03a33b6b56
commit cd4983f092
2 changed files with 24 additions and 20 deletions

View File

@ -204,6 +204,7 @@ void SCH_BITMAP::GetMsgPanelInfo( EDA_UNITS_T aUnits, MSG_PANEL_ITEMS& aList )
void SCH_BITMAP::ViewGetLayers( int aLayers[], int& aCount ) const void SCH_BITMAP::ViewGetLayers( int aLayers[], int& aCount ) const
{ {
aCount = 1; aCount = 2;
aLayers[0] = LAYER_DRAW_BITMAPS; aLayers[0] = LAYER_DRAW_BITMAPS;
aLayers[1] = LAYER_SELECTION_SHADOWS;
} }

View File

@ -238,6 +238,7 @@ float SCH_PAINTER::getShadowWidth()
COLOR4D SCH_PAINTER::getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDrawingShadows ) COLOR4D SCH_PAINTER::getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDrawingShadows )
{ {
static COLOR4D highlightColor( 1.0, 0.3, 0.3, 1.0 ); static COLOR4D highlightColor( 1.0, 0.3, 0.3, 1.0 );
static COLOR4D selectionColor = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT );
COLOR4D color = m_schSettings.GetLayerColor( aLayer ); COLOR4D color = m_schSettings.GetLayerColor( aLayer );
@ -251,13 +252,7 @@ COLOR4D SCH_PAINTER::getRenderColor( const EDA_ITEM* aItem, int aLayer, bool aDr
else if( aItem->IsSelected() ) else if( aItem->IsSelected() )
{ {
if( aDrawingShadows ) if( aDrawingShadows )
{ color = selectionColor.WithAlpha( 0.8 );
// Synthesize a "drop-shadow" color
double h, s, l;
color.ToHSL( h, s, l );
// Must allow saturation of 0 to allow greys to stay grey
color.FromHSL( h, std::min( s, 0.25 ), 0.90 );
}
} }
else if( aItem->IsHighlighted() ) // Cross-probing else if( aItem->IsHighlighted() ) // Cross-probing
{ {
@ -1516,24 +1511,32 @@ void SCH_PAINTER::draw( SCH_BITMAP *aBitmap, int aLayer )
m_gal->Save(); m_gal->Save();
m_gal->Translate( aBitmap->GetPosition() ); m_gal->Translate( aBitmap->GetPosition() );
// When the image scale factor is not 1.0, we need to modify the actual // When the image scale factor is not 1.0, we need to modify the actual as the image scale
// as the image scale factor is similar to a local zoom // factor is similar to a local zoom
double img_scale = aBitmap->GetImageScale(); double img_scale = aBitmap->GetImageScale();
if( img_scale != 1.0 ) if( img_scale != 1.0 )
m_gal->Scale( VECTOR2D( img_scale, img_scale ) ); m_gal->Scale( VECTOR2D( img_scale, img_scale ) );
m_gal->DrawBitmap( *aBitmap->GetImage() ); if( aLayer == LAYER_DRAW_BITMAPS )
if( aBitmap->IsSelected() || aBitmap->IsBrightened() || aBitmap->IsHighlighted() )
{ {
COLOR4D color = getRenderColor( aBitmap, LAYER_NOTES, false ); m_gal->DrawBitmap( *aBitmap->GetImage() );
m_gal->SetStrokeColor( color ); }
m_gal->SetIsStroke( true );
m_gal->SetIsFill( false ); if( aLayer == LAYER_SELECTION_SHADOWS )
m_gal->SetLineWidth ( getShadowWidth() ); {
m_gal->DrawRectangle( VECTOR2D( -aBitmap->GetSize().x / 2.0, -aBitmap->GetSize().y / 2.0 ), if( aBitmap->IsSelected() || aBitmap->IsBrightened() || aBitmap->IsHighlighted() )
VECTOR2D( aBitmap->GetSize().x / 2.0, aBitmap->GetSize().y / 2.0 ) ); {
COLOR4D color = getRenderColor( aBitmap, LAYER_DRAW_BITMAPS, true );
m_gal->SetIsStroke( true );
m_gal->SetStrokeColor( color );
m_gal->SetLineWidth ( getShadowWidth() );
m_gal->SetIsFill( false );
VECTOR2D origin( -aBitmap->GetSize().x / 2.0, -aBitmap->GetSize().y / 2.0 );
VECTOR2D end = origin + aBitmap->GetSize();
m_gal->DrawRectangle( origin, end );
}
} }
m_gal->Restore(); m_gal->Restore();