allowing transformation changes even if there is no graphics context around

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2006-11-04 06:39:50 +00:00
parent 6e25bf0ffb
commit fd7915711f

View File

@@ -69,6 +69,8 @@ void wxGCDC::SetGraphicsContext( wxGraphicsContext* ctx )
{ {
m_matrixOriginal = m_graphicContext->GetTransform(); m_matrixOriginal = m_graphicContext->GetTransform();
m_ok = true; m_ok = true;
// apply the stored transformations to the passed in context
ComputeScaleAndOrigin();
} }
} }
@@ -309,6 +311,8 @@ void wxGCDC::ComputeScaleAndOrigin()
m_scaleX = m_logicalScaleX * m_userScaleX; m_scaleX = m_logicalScaleX * m_userScaleX;
m_scaleY = m_logicalScaleY * m_userScaleY; m_scaleY = m_logicalScaleY * m_userScaleY;
if ( m_graphicContext )
{
m_matrixCurrent = m_graphicContext->CreateMatrix(); m_matrixCurrent = m_graphicContext->CreateMatrix();
m_matrixCurrent.Translate( m_deviceOriginX, m_deviceOriginY ); m_matrixCurrent.Translate( m_deviceOriginX, m_deviceOriginY );
m_matrixCurrent.Scale( m_scaleX, m_scaleY ); m_matrixCurrent.Scale( m_scaleX, m_scaleY );
@@ -318,6 +322,7 @@ void wxGCDC::ComputeScaleAndOrigin()
m_graphicContext->SetTransform( m_matrixOriginal ); m_graphicContext->SetTransform( m_matrixOriginal );
m_graphicContext->ConcatTransform( m_matrixCurrent ); m_graphicContext->ConcatTransform( m_matrixCurrent );
} }
}
void wxGCDC::SetPalette( const wxPalette& WXUNUSED(palette) ) void wxGCDC::SetPalette( const wxPalette& WXUNUSED(palette) )
{ {