Fix SCH_PIN location calculation

This commit is contained in:
Jon Evans 2019-04-03 22:40:14 -04:00
parent 99e57724e6
commit ff8b7cc6c1
3 changed files with 18 additions and 3 deletions

View File

@ -180,13 +180,19 @@ bool CONNECTION_SUBGRAPH::ResolveDrivers( bool aCreateMarkers )
wxASSERT( candidates[0] != candidates[1] );
auto p0 = ( candidates[0]->Type() == SCH_PIN_T ) ?
static_cast<SCH_PIN*>( candidates[0] )->GetTransformedPosition() :
candidates[0]->GetPosition();
auto p1 = ( candidates[1]->Type() == SCH_PIN_T ) ?
static_cast<SCH_PIN*>( candidates[1] )->GetTransformedPosition() :
candidates[1]->GetPosition();
auto marker = new SCH_MARKER();
marker->SetTimeStamp( GetNewTimeStamp() );
marker->SetMarkerType( MARKER_BASE::MARKER_ERC );
marker->SetErrorLevel( MARKER_BASE::MARKER_SEVERITY_WARNING );
marker->SetData( ERCE_DRIVER_CONFLICT,
candidates[0]->GetPosition(), msg,
candidates[1]->GetPosition() );
marker->SetData( ERCE_DRIVER_CONFLICT, p0, msg, p1 );
m_sheet.LastScreen()->Append( marker );

View File

@ -86,3 +86,9 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH aPath )
}
wxPoint SCH_PIN::GetTransformedPosition() const
{
auto t = m_comp->GetTransform();
return ( t.TransformCoordinate( GetPosition() ) +
m_comp->GetPosition() );
}

View File

@ -77,6 +77,9 @@ public:
void SetIsDangling( bool isDangling ) { m_isDangling = isDangling; }
/// Returns the pin's position in global coordinates
wxPoint GetTransformedPosition() const;
/*
* While many of these are currently simply covers for the equivalent LIB_PIN methods,