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
c6d1433523
commit
e160eb0677
|
@ -84,6 +84,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; }
|
||||
|
|
|
@ -73,11 +73,15 @@ public:
|
|||
|
||||
~MARKER_PCB();
|
||||
|
||||
static inline bool ClassOf( const EDA_ITEM* aItem )
|
||||
{
|
||||
return aItem && PCB_MARKER_T == aItem->Type();
|
||||
}
|
||||
|
||||
/** A scaling factor to create the marker symbol
|
||||
*/
|
||||
static int MarkerScale() {return Millimeter2iu( 0.1 ); }
|
||||
|
||||
|
||||
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