Soften hit-testing in SchEdit and LibEdit a bit.
Old threshold was 0; new is 5 pixels.
This commit is contained in:
parent
0c2ba94b16
commit
a9f663d5ef
|
@ -108,7 +108,7 @@ SEARCH_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData )
|
||||||
return SEARCH_CONTINUE;
|
return SEARCH_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aItem->HitTest( m_RefPos ) )
|
if( aItem->HitTest( m_RefPos, m_Threshold ) )
|
||||||
Append( aItem );
|
Append( aItem );
|
||||||
|
|
||||||
return SEARCH_CONTINUE;
|
return SEARCH_CONTINUE;
|
||||||
|
@ -463,7 +463,7 @@ SEARCH_RESULT EE_TYPE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* testData )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EE_TYPE_COLLECTOR::Collect( SCH_ITEM* aItem, const KICAD_T aFilterList[] )
|
void EE_TYPE_COLLECTOR::Collect( EDA_ITEM* aItem, const KICAD_T aFilterList[] )
|
||||||
{
|
{
|
||||||
Empty(); // empty the collection
|
Empty(); // empty the collection
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ public:
|
||||||
static const KICAD_T SheetsAndSheetLabels[];
|
static const KICAD_T SheetsAndSheetLabels[];
|
||||||
|
|
||||||
EE_COLLECTOR( const KICAD_T* aScanTypes = EE_COLLECTOR::AllItems ) :
|
EE_COLLECTOR( const KICAD_T* aScanTypes = EE_COLLECTOR::AllItems ) :
|
||||||
|
m_Threshold( 0 ),
|
||||||
m_MenuCancelled( false )
|
m_MenuCancelled( false )
|
||||||
{
|
{
|
||||||
SetScanTypes( aScanTypes );
|
SetScanTypes( aScanTypes );
|
||||||
|
@ -107,6 +108,8 @@ public:
|
||||||
int m_Unit; // Fixed symbol unit filter (for symbol editor)
|
int m_Unit; // Fixed symbol unit filter (for symbol editor)
|
||||||
int m_Convert; // Fixed DeMorgan filter (for symbol editor)
|
int m_Convert; // Fixed DeMorgan filter (for symbol editor)
|
||||||
|
|
||||||
|
int m_Threshold; // Hit-test threshold in internal units.
|
||||||
|
|
||||||
wxString m_MenuTitle; // The title of selection disambiguation menu (if needed)
|
wxString m_MenuTitle; // The title of selection disambiguation menu (if needed)
|
||||||
bool m_MenuCancelled; // Indicates selection disambiguation menu was cancelled
|
bool m_MenuCancelled; // Indicates selection disambiguation menu was cancelled
|
||||||
};
|
};
|
||||||
|
|
|
@ -149,6 +149,9 @@ SELECTION_CONDITION EE_CONDITIONS::SingleMultiUnitSymbol = [] ( const SELECTION&
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#define HITTEST_THRESHOLD_PIXELS 5
|
||||||
|
|
||||||
|
|
||||||
EE_SELECTION_TOOL::EE_SELECTION_TOOL() :
|
EE_SELECTION_TOOL::EE_SELECTION_TOOL() :
|
||||||
TOOL_INTERACTIVE( "eeschema.InteractiveSelection" ),
|
TOOL_INTERACTIVE( "eeschema.InteractiveSelection" ),
|
||||||
m_frame( nullptr ),
|
m_frame( nullptr ),
|
||||||
|
@ -425,6 +428,7 @@ EDA_ITEM* EE_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, const KICAD_T*
|
||||||
if( !start )
|
if( !start )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
collector.m_Threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) );
|
||||||
collector.Collect( start, aFilterList, (wxPoint) aWhere, m_unit, m_convert );
|
collector.Collect( start, aFilterList, (wxPoint) aWhere, m_unit, m_convert );
|
||||||
|
|
||||||
bool anyCollected = collector.GetCount() != 0;
|
bool anyCollected = collector.GetCount() != 0;
|
||||||
|
|
Loading…
Reference in New Issue