diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp index 02b8cfc854..084ddd689a 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp @@ -62,6 +62,11 @@ #include #include +// Harness port object itself does not contain color information about itself +// It seems altium is drawing harness ports using these colors +#define HARNESS_PORT_COLOR_DEFAULT_BACKGROUND COLOR4D( 0.92941176470588238, 0.94901960784313721, 0.98431372549019602, 1.0 ) +#define HARNESS_PORT_COLOR_DEFAULT_OUTLINE COLOR4D( 0.56078431372549020, 0.61960784313725492, 0.78823529411764703, 1.0 ) + static const VECTOR2I GetRelativePosition( const VECTOR2I& aPosition, const SCH_SYMBOL* aSymbol ) { TRANSFORM t = aSymbol->GetTransform().InverseTransform(); @@ -1495,13 +1500,8 @@ void SCH_ALTIUM_PLUGIN::ParseHarnessConnector( int aIndex, const std::mapSetBackgroundColor( m_harnessConnectorBackgroundColor ); - sheet->SetBorderColor( m_harnessConnectorBorderColor ); + sheet->SetBackgroundColor( GetColorFromInt( elem.AreaColor ) ); + sheet->SetBorderColor( GetColorFromInt( elem.Color ) ); sheet->SetScreen( screen ); @@ -2074,10 +2074,10 @@ void SCH_ALTIUM_PLUGIN::ParseHarnessPort( const ASCH_PORT& aElem ) textBox->SetEndX( ( aElem.Location + m_sheetOffset ).x + ( aElem.Width ) ); textBox->SetEndY( ( aElem.Location + m_sheetOffset ).y + ( height / 2 ) ); - textBox->SetFillColor( m_harnessConnectorBackgroundColor ); + textBox->SetFillColor( HARNESS_PORT_COLOR_DEFAULT_BACKGROUND ); textBox->SetFillMode( FILL_T::FILLED_WITH_COLOR ); - textBox->SetStroke( STROKE_PARAMS( 2, PLOT_DASH_TYPE::DEFAULT, m_harnessConnectorBorderColor ) ); + textBox->SetStroke( STROKE_PARAMS( 2, PLOT_DASH_TYPE::DEFAULT, HARNESS_PORT_COLOR_DEFAULT_OUTLINE ) ); switch( aElem.Alignment ) { diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.h b/eeschema/sch_plugins/altium/sch_altium_plugin.h index cdbdbb20fa..0351fbe7e2 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.h +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.h @@ -178,11 +178,6 @@ private: int m_harnessOwnerIndexOffset; // Add offset to all harness ownerIndex'es after parsing FileHeader int m_harnessEntryParent; // used to identify harness connector for harness entry element - - // Harness ports are drawn the same colors as harness connectors, discarding port local - // settings found in altium's file, so keep color settings to draw harness ports correctly - COLOR4D m_harnessConnectorBackgroundColor; - COLOR4D m_harnessConnectorBorderColor; }; #endif // _SCH_ALTIUM_PLUGIN_H_