Flip Viewport when Flip board is enabled

(cherry picked from commit a8e18e2d8c)
This commit is contained in:
Josue Huaroto 2023-09-03 12:30:32 +00:00 committed by Jeff Young
parent 058a0bbf93
commit 0d9d8c28f1
2 changed files with 6 additions and 1 deletions

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

@ -2903,6 +2903,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();
}