Incorrect default value (not saved in file) of DRAWSEGMENT width, for the S_POLYGON shape.
The value of the width is now always saved to avoid this kind of issue. Also Fixes: lp:173257
This commit is contained in:
parent
af8b71ac87
commit
25f9c6e4f9
|
@ -57,7 +57,8 @@ DRAWSEGMENT::DRAWSEGMENT( BOARD_ITEM* aParent, KICAD_T idtype ) :
|
|||
m_Angle = 0;
|
||||
m_Flags = 0;
|
||||
m_Shape = S_SEGMENT;
|
||||
m_Width = Millimeter2iu( 0.15 ); // Gives a decent width
|
||||
// Gives a decent pen size to draw shape:
|
||||
m_Width = m_Shape == S_POLYGON ? 0 : Millimeter2iu( 0.15 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -317,6 +318,23 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
|
|||
|
||||
break;
|
||||
|
||||
case S_POLYGON:
|
||||
{
|
||||
SHAPE_POLY_SET& outline = GetPolyShape();
|
||||
// Draw the polygon: only one polygon is expected
|
||||
// However we provide a multi polygon shape drawing
|
||||
// ( for the future or to show a non expected shape )
|
||||
for( int jj = 0; jj < outline.OutlineCount(); ++jj )
|
||||
{
|
||||
SHAPE_LINE_CHAIN& poly = outline.Outline( jj );
|
||||
|
||||
GRClosedPoly( panel->GetClipBox(), DC, poly.PointCount(),
|
||||
(wxPoint*)&poly.Point( 0 ), FILLED, GetWidth(),
|
||||
color, color );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if( filled )
|
||||
{
|
||||
|
|
|
@ -57,8 +57,8 @@ protected:
|
|||
wxPoint m_BezierC1; ///< Bezier Control Point 1
|
||||
wxPoint m_BezierC2; ///< Bezier Control Point 2
|
||||
|
||||
std::vector<wxPoint> m_BezierPoints;
|
||||
SHAPE_POLY_SET m_Poly;
|
||||
std::vector<wxPoint> m_BezierPoints;
|
||||
SHAPE_POLY_SET m_Poly; ///< Stores the S_POLYGON shape
|
||||
|
||||
// Computes the bounding box for an arc
|
||||
void computeArcBBox( EDA_RECT& aBBox ) const;
|
||||
|
|
|
@ -920,8 +920,7 @@ void PCB_IO::format( DRAWSEGMENT* aSegment, int aNestLevel ) const
|
|||
|
||||
formatLayer( aSegment );
|
||||
|
||||
if( aSegment->GetWidth() != 0 )
|
||||
m_out->Print( 0, " (width %s)", FMT_IU( aSegment->GetWidth() ).c_str() );
|
||||
m_out->Print( 0, " (width %s)", FMT_IU( aSegment->GetWidth() ).c_str() );
|
||||
|
||||
if( aSegment->GetTimeStamp() )
|
||||
m_out->Print( 0, " (tstamp %lX)", (unsigned long)aSegment->GetTimeStamp() );
|
||||
|
@ -1463,10 +1462,7 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
|
|||
}
|
||||
}
|
||||
|
||||
if( primitive.m_Thickness != 0 )
|
||||
m_out->Print( 0, ") (width %s))", FMT_IU( primitive.m_Thickness ).c_str() );
|
||||
else
|
||||
m_out->Print( 0, "))");
|
||||
m_out->Print( 0, ") (width %s))", FMT_IU( primitive.m_Thickness ).c_str() );
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -1438,6 +1438,7 @@ DRAWSEGMENT* PCB_PARSER::parseDRAWSEGMENT()
|
|||
case T_gr_poly:
|
||||
{
|
||||
segment->SetShape( S_POLYGON );
|
||||
segment->SetWidth( 0 ); // this is the default value. will be (perhaps) modified later
|
||||
NeedLEFT();
|
||||
token = NextTok();
|
||||
|
||||
|
|
Loading…
Reference in New Issue