Set line width when changing annotation proxy flag.

(This prevents rectangle from not getting combined into pad if
proxy flag is turned off as Clipper collapses the polygon union
because it's too small.)
This commit is contained in:
Jeff Young 2023-09-04 20:48:34 +01:00
parent 7c718db5d2
commit ea6d64e996
5 changed files with 22 additions and 5 deletions

View File

@ -85,8 +85,8 @@ public:
wxString SHAPE_T_asString() const;
bool IsAnnotationProxy() const { return m_annotationProxy; }
void SetIsAnnotationProxy( bool aIsProxy = true ) { m_annotationProxy = aIsProxy; }
virtual bool IsAnnotationProxy() const { return m_annotationProxy; }
virtual void SetIsAnnotationProxy( bool aIsProxy = true ) { m_annotationProxy = aIsProxy; }
bool IsFilled() const
{

View File

@ -96,8 +96,11 @@ private:
PCB_PLOT_PARAMS m_plotOpts;
wxRearrangeList* m_plotAllLayersList;
#if 0
STD_BITMAP_BUTTON* m_bpMoveUp;
STD_BITMAP_BUTTON* m_bpMoveDown;
#endif
/// The plot layer set that last time the dialog was opened.
static LSET m_lastLayerSet;

View File

@ -119,7 +119,7 @@ void ConnectBoardShapes( std::vector<PCB_SHAPE*>& aShapeList,
}
}
else if( ( shape0 == SHAPE_T::ARC && shape1 == SHAPE_T::SEGMENT )
|| shape0 == SHAPE_T::SEGMENT && shape1 == SHAPE_T::ARC )
|| ( shape0 == SHAPE_T::SEGMENT && shape1 == SHAPE_T::ARC ) )
{
PCB_SHAPE* arcShape = shape0 == SHAPE_T::ARC ? aPrevShape : aShape;
PCB_SHAPE* segShape = shape0 == SHAPE_T::SEGMENT ? aPrevShape : aShape;

View File

@ -354,6 +354,17 @@ void PCB_SHAPE::Mirror( const VECTOR2I& aCentre, bool aMirrorAroundXAxis )
}
void PCB_SHAPE::SetIsAnnotationProxy( bool aIsProxy )
{
if( aIsProxy && !m_annotationProxy )
SetStroke( STROKE_PARAMS( 1 ) );
else if( m_annotationProxy && !aIsProxy )
SetStroke( STROKE_PARAMS( pcbIUScale.mmToIU( DEFAULT_LINE_WIDTH ) ) );
m_annotationProxy = aIsProxy;
}
double PCB_SHAPE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{
constexpr double HIDE = std::numeric_limits<double>::max();
@ -602,8 +613,8 @@ static struct PCB_SHAPE_DESC
const wxString groupPadPrimitives = _HKI( "Pad Primitives" );
propMgr.AddProperty( new PROPERTY<EDA_SHAPE, bool>( _HKI( "Number Box" ),
&EDA_SHAPE::SetIsAnnotationProxy, &EDA_SHAPE::IsAnnotationProxy ),
propMgr.AddProperty( new PROPERTY<PCB_SHAPE, bool>( _HKI( "Number Box" ),
&PCB_SHAPE::SetIsAnnotationProxy, &PCB_SHAPE::IsAnnotationProxy ),
groupPadPrimitives )
.SetAvailableFunc( isPadEditMode );
}

View File

@ -102,6 +102,9 @@ public:
std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
FLASHING aFlash = FLASHING::DEFAULT ) const override;
bool IsAnnotationProxy() const override { return m_annotationProxy; }
void SetIsAnnotationProxy( bool aIsProxy = true ) override;
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
const BOX2I GetBoundingBox() const override { return getBoundingBox(); }