-// TODO CS
- dc->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) );
- // triggers an application of the already set device origins to the native context
- dc->SetUserScale(1,1);
- wxSize size = dc->GetSize() ;
- dc->SetClippingRegion( 0 , 0 , size.x , size.y ) ;
+ wxDCImpl *impl = dc->GetImpl();
+ wxGCDCImpl *win_impl = wxDynamicCast(impl,wxGCDCImpl);
+ if (win_impl)
+ {
+ win_impl->SetGraphicsContext( wxGraphicsContext::CreateFromNative( m_overlayContext ) );
+ dc->SetClippingRegion( m_x , m_y , m_width , m_height ) ;
+ }