PCB Editor: fix pad preview sketch mode not applying immediately

This commit is contained in:
Mike Williams 2022-12-28 09:18:55 -05:00
parent 13f67aa7ce
commit d62681f6db
3 changed files with 3 additions and 20 deletions

View File

@ -332,11 +332,7 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas()
// fix the pad render mode (filled/not filled) // fix the pad render mode (filled/not filled)
auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() ); auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
if( m_cbShowPadOutline->IsChecked() ) settings->m_ForcePadSketchModeOn = m_cbShowPadOutline->IsChecked();
settings->m_ForcePadSketchModeOn = true;
else
settings->m_ForcePadSketchModeOff = true;
settings->SetHighContrast( false ); settings->SetHighContrast( false );
settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL; settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
@ -783,11 +779,7 @@ void DIALOG_PAD_PROPERTIES::onChangePadMode( wxCommandEvent& event )
// fix the pad render mode (filled/not filled) // fix the pad render mode (filled/not filled)
auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() ); auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
if( m_cbShowPadOutline->IsChecked() ) settings->m_ForcePadSketchModeOn = m_cbShowPadOutline->IsChecked();
settings->m_ForcePadSketchModeOn = true;
else
settings->m_ForcePadSketchModeOff = true;
settings->SetHighContrast( false ); settings->SetHighContrast( false );
settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL; settings->m_ContrastModeDisplay = HIGH_CONTRAST_MODE::NORMAL;
@ -1585,11 +1577,6 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow()
commit.Modify( m_currentPad ); commit.Modify( m_currentPad );
// redraw the area where the pad was, without pad (delete pad on screen)
m_currentPad->SetFlags( DO_NOT_DRAW );
m_parent->GetCanvas()->Refresh();
m_currentPad->ClearFlags( DO_NOT_DRAW );
// Update values // Update values
m_currentPad->SetShape( m_padMaster->GetShape() ); m_currentPad->SetShape( m_padMaster->GetShape() );
m_currentPad->SetAttribute( m_padMaster->GetAttribute() ); m_currentPad->SetAttribute( m_padMaster->GetAttribute() );

View File

@ -111,7 +111,6 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
m_zoneOpacity = 1.0; m_zoneOpacity = 1.0;
m_imageOpacity = 1.0; m_imageOpacity = 1.0;
m_ForcePadSketchModeOff = false;
m_ForcePadSketchModeOn = false; m_ForcePadSketchModeOn = false;
SetDashLengthRatio( 12 ); // From ISO 128-2 SetDashLengthRatio( 12 ); // From ISO 128-2
@ -1195,9 +1194,7 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
bool outline_mode = !viewer_settings()->m_ViewersDisplay.m_DisplayPadFill; bool outline_mode = !viewer_settings()->m_ViewersDisplay.m_DisplayPadFill;
if( m_pcbSettings.m_ForcePadSketchModeOff ) if( m_pcbSettings.m_ForcePadSketchModeOn )
outline_mode = false;
else if( m_pcbSettings.m_ForcePadSketchModeOn )
outline_mode = true; outline_mode = true;
if( outline_mode ) if( outline_mode )

View File

@ -119,7 +119,6 @@ public:
const std::set<int>& GetHiddenNets() const { return m_hiddenNets; } const std::set<int>& GetHiddenNets() const { return m_hiddenNets; }
public: public:
bool m_ForcePadSketchModeOff;
bool m_ForcePadSketchModeOn; bool m_ForcePadSketchModeOn;
ZONE_DISPLAY_MODE m_ZoneDisplayMode; ZONE_DISPLAY_MODE m_ZoneDisplayMode;