pcbnew: Adding some missing TypeOf() functions
Missing types were handled by the superclass (in the case of zones) PCB_CONNECTED_ITEM, which incorrectly returned "true" when testing lines against zones. Fixes: lp:1789195 * https://bugs.launchpad.net/kicad/+bug/1789195
This commit is contained in:
parent
b7a321d143
commit
d8e276bc4f
|
@ -83,6 +83,11 @@ public:
|
|||
|
||||
~DIMENSION();
|
||||
|
||||
static inline bool ClassOf( const EDA_ITEM* aItem )
|
||||
{
|
||||
return aItem && PCB_DIMENSION_T == aItem->Type();
|
||||
}
|
||||
|
||||
void SetValue( int aValue ) { m_Value = aValue; }
|
||||
|
||||
int GetValue() const { return m_Value; }
|
||||
|
|
|
@ -70,6 +70,11 @@ public:
|
|||
|
||||
~MARKER_PCB();
|
||||
|
||||
static inline bool ClassOf( const EDA_ITEM* aItem )
|
||||
{
|
||||
return aItem && PCB_MARKER_T == aItem->Type();
|
||||
}
|
||||
|
||||
void Move(const wxPoint& aMoveVector) override
|
||||
{
|
||||
m_Pos += aMoveVector;
|
||||
|
|
|
@ -58,6 +58,11 @@ public:
|
|||
|
||||
~PCB_TARGET();
|
||||
|
||||
static inline bool ClassOf( const EDA_ITEM* aItem )
|
||||
{
|
||||
return aItem && PCB_TARGET_T == aItem->Type();
|
||||
}
|
||||
|
||||
void SetPosition( const wxPoint& aPos ) override { m_Pos = aPos; }
|
||||
const wxPoint GetPosition() const override { return m_Pos; }
|
||||
|
||||
|
|
|
@ -73,6 +73,12 @@ public:
|
|||
|
||||
~ZONE_CONTAINER();
|
||||
|
||||
static inline bool ClassOf( const EDA_ITEM* aItem )
|
||||
{
|
||||
return aItem && ( ( PCB_ZONE_AREA_T == aItem->Type() ) ||
|
||||
( PCB_ZONE_T == aItem->Type() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Function GetPosition
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue