From f21e24cd17d4a1eee8dc20bc73f61494fa6bd071 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 8 Sep 2019 22:54:13 +0100 Subject: [PATCH] Fix pin rotatation and SPICE current probe statement for 2-pin symbols Fixes: lp:1843159 * https://bugs.launchpad.net/kicad/+bug/1843159 --- eeschema/sch_pin.cpp | 3 ++- eeschema/tools/sch_editor_control.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index b5f1059399..9427e85d4d 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -125,7 +125,8 @@ const EDA_RECT SCH_PIN::GetBoundingBox() const TRANSFORM t = GetParentComponent()->GetTransform(); EDA_RECT r = m_libPin->GetBoundingBox(); - t.y2 = -t.y2; + r.RevertYAxis(); + r = t.TransformCoordinate( r ); r.Offset( GetParentComponent()->GetPosition() ); diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index cc2ef88339..70144f5e52 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -469,7 +469,12 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent ) { SCH_PIN* pin = (SCH_PIN*) item; SCH_COMPONENT* comp = (SCH_COMPONENT*) item->GetParent(); - wxString param = wxString::Format( _T( "I%s" ), pin->GetName().Lower() ); + wxString param; + + if( comp->GetPins().size() <= 2 ) + param = wxT( "I" ); + else + param = wxString::Format( wxT( "I%s" ), pin->GetName().Lower() ); simFrame->AddCurrentPlot( comp->GetRef( g_CurrentSheet ), param ); }