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
This commit is contained in:
Seth Hillbrand 2019-02-15 15:59:37 -08:00
parent 79f990266b
commit c37aac56e6
2 changed files with 4 additions and 4 deletions

View File

@ -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 );

View File

@ -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<SCH_EDIT_FRAME*>( frame )->GetShowAllPins();
else if( frame->IsType( FRAME_SCH_LIB_EDITOR ) )
drawHidden = true; // must be able to edit
}
if( !drawHidden )