pcb_parser.cpp: allows 0 width line thickness for circles in custom shaped pads.
the commit 1100ccb032
broke DRAWSEGMENT filled circles (line width = 0) used only in custom pads.
Fixes: lp:1792791
https://bugs.launchpad.net/kicad/+bug/1792791
This commit is contained in:
parent
2196959539
commit
ac0c7441b4
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 CERN
|
* Copyright (C) 2012 CERN
|
||||||
* Copyright (C) 2012-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2012-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -1370,7 +1370,7 @@ void PCB_PARSER::parseNETCLASS()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DRAWSEGMENT* PCB_PARSER::parseDRAWSEGMENT()
|
DRAWSEGMENT* PCB_PARSER::parseDRAWSEGMENT( bool aAllowCirclesZeroWidth )
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( CurTok() == T_gr_arc || CurTok() == T_gr_circle || CurTok() == T_gr_curve ||
|
wxCHECK_MSG( CurTok() == T_gr_arc || CurTok() == T_gr_circle || CurTok() == T_gr_curve ||
|
||||||
CurTok() == T_gr_line || CurTok() == T_gr_poly, NULL,
|
CurTok() == T_gr_line || CurTok() == T_gr_poly, NULL,
|
||||||
|
@ -1534,7 +1534,9 @@ DRAWSEGMENT* PCB_PARSER::parseDRAWSEGMENT()
|
||||||
// Only filled polygons may have a zero-line width
|
// Only filled polygons may have a zero-line width
|
||||||
// This is not permitted in KiCad but some external tools generate invalid
|
// This is not permitted in KiCad but some external tools generate invalid
|
||||||
// files.
|
// files.
|
||||||
if( segment->GetShape() != S_POLYGON && segment->GetWidth() == 0 )
|
// However in custom pad shapes, zero-line width is allowed for filled circles
|
||||||
|
if( segment->GetShape() != S_POLYGON && segment->GetWidth() == 0 &&
|
||||||
|
!( segment->GetShape() == S_CIRCLE && aAllowCirclesZeroWidth ) )
|
||||||
segment->SetWidth( Millimeter2iu( DEFAULT_LINE_WIDTH ) );
|
segment->SetWidth( Millimeter2iu( DEFAULT_LINE_WIDTH ) );
|
||||||
|
|
||||||
return segment.release();
|
return segment.release();
|
||||||
|
@ -2576,7 +2578,8 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_gr_circle:
|
case T_gr_circle:
|
||||||
dummysegm = parseDRAWSEGMENT();
|
dummysegm = parseDRAWSEGMENT( true ); // Circles with 0 thickness are allowed
|
||||||
|
// ( filled circles )
|
||||||
pad->AddPrimitive( dummysegm->GetCenter(), dummysegm->GetRadius(),
|
pad->AddPrimitive( dummysegm->GetCenter(), dummysegm->GetRadius(),
|
||||||
dummysegm->GetWidth() );
|
dummysegm->GetWidth() );
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 CERN
|
* Copyright (C) 2012 CERN
|
||||||
* Copyright (C) 2012-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2012-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -113,7 +113,11 @@ class PCB_PARSER : public PCB_LEXER
|
||||||
void parseNETINFO_ITEM();
|
void parseNETINFO_ITEM();
|
||||||
void parseNETCLASS();
|
void parseNETCLASS();
|
||||||
|
|
||||||
DRAWSEGMENT* parseDRAWSEGMENT();
|
/** Read a DRAWSEGMENT description.
|
||||||
|
* @param aAllowCirclesZeroWidth = true to allow items with 0 width
|
||||||
|
* Only used in custom pad shapes for filled circles.
|
||||||
|
*/
|
||||||
|
DRAWSEGMENT* parseDRAWSEGMENT( bool aAllowCirclesZeroWidth = false );
|
||||||
TEXTE_PCB* parseTEXTE_PCB();
|
TEXTE_PCB* parseTEXTE_PCB();
|
||||||
DIMENSION* parseDIMENSION();
|
DIMENSION* parseDIMENSION();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue