Eeschema plot: fix (temporary) line 0 thickness.

Plotting lines having 0 thickness is not acceptable and create issues.
This commit is contained in:
jean-pierre charras 2020-04-14 12:43:51 +02:00
parent 04ea20dd44
commit 6148461484
12 changed files with 111 additions and 12 deletions

View File

@ -207,7 +207,15 @@ void LIB_BEZIER::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
int LIB_BEZIER::GetPenSize() const
{
if( m_Width )
return m_Width;
#if 1
// Temporary code not using RENDER_SETTINGS
return DEFAULT_LINE_THICKNESS * IU_PER_MILS;
#else
// JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -194,7 +194,15 @@ void LIB_CIRCLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
int LIB_CIRCLE::GetPenSize() const
{
if( m_Width )
return m_Width;
#if 1
// Temporary code not using RENDER_SETTINGS
return DEFAULT_LINE_THICKNESS * IU_PER_MILS;
#else
// JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -101,7 +101,14 @@ void LIB_FIELD::Init( int id )
int LIB_FIELD::GetPenSize() const
{
#if 1
// Temporary code not using RENDER_SETTINGS
int textThickness = DEFAULT_LINE_THICKNESS * IU_PER_MILS;
textThickness = Clamp_Text_PenSize( textThickness, GetTextSize(), IsBold() );
return textThickness;
#else
return GetEffectiveTextPenWidth( nullptr ); // JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -539,7 +539,15 @@ bool LIB_PIN::HitTest( const wxPoint& aPosition, int aAccuracy ) const
int LIB_PIN::GetPenSize() const
{
if( m_width )
return m_width;
#if 1
// Temporary code not using RENDER_SETTINGS
return DEFAULT_LINE_THICKNESS * IU_PER_MILS;
#else
// JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -198,7 +198,15 @@ void LIB_POLYLINE::RemoveCorner( int aIdx )
int LIB_POLYLINE::GetPenSize() const
{
if( m_Width )
return m_Width;
#if 1
// Temporary code not using RENDER_SETTINGS
return DEFAULT_LINE_THICKNESS * IU_PER_MILS;
#else
// JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -159,7 +159,15 @@ void LIB_RECTANGLE::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
int LIB_RECTANGLE::GetPenSize() const
{
if( m_Width )
return m_Width;
#if 1
// Temporary code not using RENDER_SETTINGS
return DEFAULT_LINE_THICKNESS * IU_PER_MILS;
#else
// JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -300,7 +300,14 @@ void LIB_TEXT::Plot( PLOTTER* plotter, const wxPoint& offset, bool fill,
int LIB_TEXT::GetPenSize() const
{
#if 1
// Temporary code not using RENDER_SETTINGS
int textThickness = DEFAULT_LINE_THICKNESS * IU_PER_MILS;
textThickness = Clamp_Text_PenSize( textThickness, GetTextSize(), IsBold() );
return textThickness;
#else
return GetEffectiveTextPenWidth( nullptr ); // JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -128,13 +128,23 @@ const EDA_RECT SCH_BUS_ENTRY_BASE::GetBoundingBox() const
int SCH_BUS_WIRE_ENTRY::GetPenSize() const
{
return 0; // use default wire thickness
#if 1
// Temporary code not using RENDER_SETTINGS
return DEFAULT_WIRE_THICKNESS * IU_PER_MILS;
#else
// JEY TODO: requires RENDER_SETTINGS
#endif
}
int SCH_BUS_BUS_ENTRY::GetPenSize() const
{
return 0; // use default bus thickness
#if 1
// Temporary code not using RENDER_SETTINGS
return DEFAULT_BUS_THICKNESS * IU_PER_MILS;
#else
// JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -131,7 +131,14 @@ wxString SCH_FIELD::GetShownText( int aDepth ) const
int SCH_FIELD::GetPenSize() const
{
#if 1
// Temporary code not using RENDER_SETTINGS
int textThickness = DEFAULT_LINE_THICKNESS * IU_PER_MILS;
textThickness = Clamp_Text_PenSize( textThickness, GetTextSize(), IsBold() );
return textThickness;
#else
return GetEffectiveTextPenWidth( nullptr ); // JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -291,7 +291,22 @@ void SCH_LINE::SetLineWidth( const int aSize )
int SCH_LINE::GetPenSize() const
{
if( m_size )
return m_size;
#if 1
// Temporary code not using RENDER_SETTINGS
int thickness = DEFAULT_LINE_THICKNESS * IU_PER_MILS;
if( GetLayer() == LAYER_BUS )
thickness = DEFAULT_BUS_THICKNESS * IU_PER_MILS;
else if( GetLayer() == LAYER_WIRE )
thickness = DEFAULT_WIRE_THICKNESS * IU_PER_MILS;
return thickness;
#else
// JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -97,7 +97,13 @@ void SCH_NO_CONNECT::GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList )
int SCH_NO_CONNECT::GetPenSize() const
{
return 0; // use default pen size
#if 1
// Temporary code not using RENDER_SETTINGS
int thickness = DEFAULT_LINE_THICKNESS * IU_PER_MILS;
return thickness;
#else
// JEY TODO: requires RENDER_SETTINGS
#endif
}

View File

@ -282,7 +282,14 @@ bool SCH_TEXT::operator<( const SCH_ITEM& aItem ) const
int SCH_TEXT::GetPenSize() const
{
#if 1
// Temporary code not using RENDER_SETTINGS
int textThickness = DEFAULT_LINE_THICKNESS * IU_PER_MILS;
textThickness = Clamp_Text_PenSize( textThickness, GetTextSize(), IsBold() );
return textThickness;
#else
return GetEffectiveTextPenWidth( nullptr ); // JEY TODO: requires RENDER_SETTINGS
#endif
}
@ -570,7 +577,7 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter )
{
static std::vector<wxPoint> Poly;
COLOR4D color = aPlotter->ColorSettings()->GetColor( GetLayer() );
int penWidth = GetEffectiveTextPenWidth( nullptr );
int penWidth = GetPenSize();
aPlotter->SetCurrentLineWidth( penWidth );