From effc8bebb143fb2a5459a6586ff8b083665b3d52 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 12 Dec 2016 11:51:08 +0100 Subject: [PATCH] Store view flip setting between canvas changes --- common/view/view.cpp | 6 ++++++ include/view/view.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/common/view/view.cpp b/common/view/view.cpp index f80fc3d22f..2f09553fa6 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -256,6 +256,7 @@ VIEW::VIEW( bool aIsDynamic ) : m_enableOrderModifier( true ), m_scale( 4.0 ), m_minScale( 4.0 ), m_maxScale( 15000 ), + m_mirrorX( false ), m_mirrorY( false ), m_painter( NULL ), m_gal( NULL ), m_dynamic( aIsDynamic ) @@ -478,6 +479,7 @@ void VIEW::SetGAL( GAL* aGal ) // force the new GAL to display the current viewport. SetCenter( m_center ); SetScale( m_scale ); + SetMirror( m_mirrorX, m_mirrorY ); } @@ -510,6 +512,10 @@ void VIEW::SetViewport( const BOX2D& aViewport ) void VIEW::SetMirror( bool aMirrorX, bool aMirrorY ) { + wxASSERT_MSG( !aMirrorY, _( "Mirroring for Y axis is not supported yet" ) ); + + m_mirrorX = aMirrorX; + m_mirrorY = aMirrorY; m_gal->SetFlip( aMirrorX, aMirrorY ); // Redraw everything diff --git a/include/view/view.h b/include/view/view.h index aadd42ad4e..2ad3f71301 100644 --- a/include/view/view.h +++ b/include/view/view.h @@ -734,6 +734,12 @@ private: /// Scale upper limit double m_maxScale; + ///> Horizontal flip flag + bool m_mirrorX; + + ///> Vertical flip flag + bool m_mirrorY; + /// PAINTER contains information how do draw items PAINTER* m_painter;