7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 19:03:45 +00:00

Flip Viewport when Flip board is enabled

This commit is contained in:
Josue Huaroto 2023-09-03 12:30:32 +00:00 committed by Jeff Young
parent 38748cce84
commit a8e18e2d8c
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions
common/view
pcbnew/widgets

View File

@ -521,7 +521,7 @@ void VIEW::SetViewport( const BOX2D& aViewport )
{
VECTOR2D ssize = ToWorld( m_gal->GetScreenPixelSize(), false );
wxCHECK( ssize.x > 0 && ssize.y > 0, /*void*/ );
wxCHECK( fabs(ssize.x) > 0 && fabs(ssize.y) > 0, /*void*/ );
VECTOR2D centre = aViewport.Centre();
VECTOR2D vsize = aViewport.GetSize();

View File

@ -2906,6 +2906,11 @@ void APPEARANCE_CONTROLS::onViewportChanged( wxCommandEvent& aEvent )
void APPEARANCE_CONTROLS::doApplyViewport( const VIEWPORT& aViewport )
{
m_frame->GetCanvas()->GetView()->SetViewport( aViewport.rect );
if( m_cbFlipBoard->GetValue() )
{
m_frame->GetCanvas()->GetView()->SetMirror( true, false );
m_frame->GetCanvas()->GetView()->RecacheAllItems();
}
m_frame->GetCanvas()->Refresh();
}