From c37aac56e6a16fbf9c74e646d15e282aef451368 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 15 Feb 2019 15:59:37 -0800 Subject: [PATCH] libedit: Set initial pin properties when editing This allows the invisible pins to be drawn as grey Fixes: lp:1816178 * https://bugs.launchpad.net/kicad/+bug/1816178 --- eeschema/dialogs/dialog_lib_edit_pin.cpp | 4 +++- eeschema/lib_pin.cpp | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eeschema/dialogs/dialog_lib_edit_pin.cpp b/eeschema/dialogs/dialog_lib_edit_pin.cpp index dfc2dd8087..13d96f5ae7 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin.cpp +++ b/eeschema/dialogs/dialog_lib_edit_pin.cpp @@ -100,6 +100,8 @@ bool DIALOG_LIB_EDIT_PIN::TransferDataToWindow() m_checkApplyToAllConversions->SetValue( m_pin->GetConvert() == 0 ); m_checkShow->SetValue( m_pin->IsVisible() ); + m_dummyPin->SetVisible( m_pin->IsVisible() ); + return true; } @@ -157,7 +159,7 @@ void DIALOG_LIB_EDIT_PIN::OnPaintShowPanel( wxPaintEvent& event ) m_dummyPin->SetParent( libframe->GetCurPart() ); // Calculate a suitable scale to fit the available draw area - EDA_RECT bBox = m_dummyPin->GetBoundingBox(); + EDA_RECT bBox = m_dummyPin->GetBoundingBox( true ); double xscale = (double) dc_size.x / bBox.GetWidth(); double yscale = (double) dc_size.y / bBox.GetHeight(); double scale = std::min( xscale, yscale ); diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index a04ed3d771..adc3262b98 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -600,7 +600,7 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel, // They are drawn in GetInvisibleItemColor(). if( ! IsVisible() ) { - bool drawHidden = false; + bool drawHidden = true; if( aPanel && aPanel->GetParent() ) { @@ -608,8 +608,6 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANEL* aPanel, if( frame->IsType( FRAME_SCH ) ) drawHidden = static_cast( frame )->GetShowAllPins(); - else if( frame->IsType( FRAME_SCH_LIB_EDITOR ) ) - drawHidden = true; // must be able to edit } if( !drawHidden )