Browse Source

Do not show click to start wire cursor for hidden pins.

Selecting show hidden pins will allow users to connect to hidden pins.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17145

(cherry picked from commit ca18dc8ec8)
8.0
Wayne Stambaugh 2 years ago
parent
commit
9fd2b32665
  1. 23
      eeschema/sch_symbol.cpp
  2. 9
      eeschema/sch_symbol.h
  3. 13
      eeschema/tools/ee_selection_tool.cpp

23
eeschema/sch_symbol.cpp

@ -1146,6 +1146,29 @@ SCH_PIN* SCH_SYMBOL::GetPin( const wxString& aNumber ) const
}
const SCH_PIN* SCH_SYMBOL::GetPin( const VECTOR2I& aPos ) const
{
for( const std::unique_ptr<SCH_PIN>& pin : m_pins )
{
int pin_unit = pin->GetLibPin() ? pin->GetLibPin()->GetUnit()
: GetUnit();
int pin_bodyStyle = pin->GetLibPin() ? pin->GetLibPin()->GetBodyStyle()
: GetBodyStyle();
if( pin_unit > 0 && pin_unit != GetUnit() )
continue;
if( pin_bodyStyle > 0 && pin_bodyStyle != GetBodyStyle() )
continue;
if( pin->IsPointClickableAnchor( aPos ) )
return pin.get();
}
return nullptr;
}
void SCH_SYMBOL::GetLibPins( std::vector<LIB_PIN*>& aPinsList ) const
{
if( m_part )

9
eeschema/sch_symbol.h

@ -635,6 +635,15 @@ public:
*/
SCH_PIN* GetPin( LIB_PIN* aLibPin ) const;
/**
* Return the #SCH_PIN object found at \a aPosition.
*
* @param aPosition is the position of the pin to fetch.
*
* @return the #SCH_PIN object found at \a aPosition or nullptr.
*/
const SCH_PIN* GetPin( const VECTOR2I& aPosition ) const;
/**
* Retrieve a list of the SCH_PINs for the given sheet path.
*

13
eeschema/tools/ee_selection_tool.cpp

@ -953,6 +953,19 @@ OPT_TOOL_EVENT EE_SELECTION_TOOL::autostartEvent( TOOL_EVENT* aEvent, EE_GRID_HE
if( possibleConnection.IsBus() )
newEvt = EE_ACTIONS::drawBus.MakeEvent();
}
else if( aItem->Type() == SCH_SYMBOL_T )
{
const SCH_SYMBOL* symbol = static_cast<const SCH_SYMBOL*>( aItem );
wxCHECK( symbol, OPT_TOOL_EVENT() );
const SCH_PIN* pin = symbol->GetPin( pos );
wxCHECK( pin, OPT_TOOL_EVENT() );
if( !pin->IsVisible() && !m_frame->eeconfig()->m_Appearance.show_hidden_pins )
return OPT_TOOL_EVENT();
}
newEvt->SetMousePosition( pos );
newEvt->SetHasPosition( true );

Loading…
Cancel
Save