Eeschema, Modedit: void fields (mainly the footprint field) now cannot be selected when click on them.

This commit is contained in:
jean-pierre charras 2010-12-20 20:18:20 +01:00
parent 5bab73d638
commit aec75256c9
2 changed files with 14 additions and 0 deletions

View File

@ -350,6 +350,11 @@ void LIB_FIELD::drawGraphic( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint&
bool LIB_FIELD::HitTest( const wxPoint& aPosition )
{
// Because HitTest is mainly used to select the field
// return always false if this field is void
if( IsVoid() )
return false;
return HitTest( aPosition, 0, DefaultTransform );
}

View File

@ -106,6 +106,15 @@ public:
void SetFields( const std::vector <LIB_FIELD> aFields );
/**
* Function IsVoid
* @return true if the field value is void (no text in this field)
*/
bool IsVoid()
{
return m_Text.IsEmpty();
}
/**
* Function IsVisible
* @return true is this field is visible, false if flagged invisible