Pin junction dot size to no less than 170% of wire width.

Fixes https://gitlab.com/kicad/code/kicad/issues/4917
This commit is contained in:
Jeff Young 2020-07-30 20:03:38 +01:00
parent e88dda2c01
commit 310613a941
3 changed files with 18 additions and 5 deletions

View File

@ -184,6 +184,22 @@ COLOR4D SCH_JUNCTION::GetColor() const
}
int SCH_JUNCTION::GetDiameter() const
{
int diameter = m_diameter;
if( diameter == 0 )
diameter = Schematic()->Settings().m_JunctionSize;
NETCLASSPTR netclass = NetClass();
if( netclass )
diameter = std::max( diameter, KiROUND( netclass->GetWireWidth() * 1.7 ) );
return std::max( diameter, 1 );
}
bool SCH_JUNCTION::HitTest( const wxPoint& aPosition, int aAccuracy ) const
{
EDA_RECT rect = GetBoundingBox();

View File

@ -97,7 +97,7 @@ public:
wxPoint GetPosition() const override { return m_pos; }
void SetPosition( const wxPoint& aPosition ) override { m_pos = aPosition; }
int GetDiameter() const { return m_diameter; }
int GetDiameter() const;
void SetDiameter( int aDiameter ) { m_diameter = aDiameter; }
COLOR4D GetColor() const;

View File

@ -1179,10 +1179,7 @@ void SCH_PAINTER::draw( SCH_JUNCTION *aJct, int aLayer )
COLOR4D color = getRenderColor( aJct, aJct->GetLayer(), drawingShadows );
int junctionSize = m_schSettings.m_JunctionSize / 2.0;
if( aJct->GetDiameter() != 0 )
junctionSize = aJct->GetDiameter() / 2;
int junctionSize = aJct->GetDiameter() / 2;
m_gal->SetIsStroke( drawingShadows );
m_gal->SetLineWidth( getLineWidth( aJct, drawingShadows ) );