Handle DPI-change for footprint 3D-previews in Footprint Chooser.
This commit is contained in:
parent
2681461992
commit
f907b58d17
|
@ -135,6 +135,20 @@ DIALOG_FOOTPRINT_CHOOSER::DIALOG_FOOTPRINT_CHOOSER( PCB_BASE_FRAME* aParent,
|
||||||
wxCommandEventHandler( DIALOG_FOOTPRINT_CHOOSER::onFpViewReq ),
|
wxCommandEventHandler( DIALOG_FOOTPRINT_CHOOSER::onFpViewReq ),
|
||||||
nullptr, this );
|
nullptr, this );
|
||||||
|
|
||||||
|
Bind( wxEVT_MOVE,
|
||||||
|
[this]( wxMoveEvent& aEvent )
|
||||||
|
{
|
||||||
|
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
|
||||||
|
const DPI_SCALING_COMMON dpi( settings, this );
|
||||||
|
|
||||||
|
if( m_preview3DCanvas->GetScaleFactor() != dpi.GetScaleFactor() )
|
||||||
|
{
|
||||||
|
m_preview3DCanvas->SetScaleFactor( dpi.GetScaleFactor() );
|
||||||
|
m_preview3DCanvas->ReloadRequest();
|
||||||
|
m_preview3DCanvas->Refresh();
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
Connect( FP_SELECTION_EVENT, wxCommandEventHandler( DIALOG_FOOTPRINT_CHOOSER::onFpChanged ),
|
Connect( FP_SELECTION_EVENT, wxCommandEventHandler( DIALOG_FOOTPRINT_CHOOSER::onFpChanged ),
|
||||||
nullptr, this );
|
nullptr, this );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue