- wxASSERT( mode == srcCopy ) ;
- if ( LockPixels( GetGWorldPixMap( source->m_macMask ) ) )
- {
- CopyMask( GetPortBitMapForCopyBits( sourcePort ) ,
- GetPortBitMapForCopyBits( source->m_macMask ) ,
- GetPortBitMapForCopyBits( m_macPort ) ,
- &srcrect, &srcrect , &dstrect ) ;
- UnlockPixels( GetGWorldPixMap( source->m_macMask ) ) ;
- }
+ if ( mode == srcCopy )
+ {
+ if ( LockPixels( GetGWorldPixMap( source->m_macMask ) ) )
+ {
+ CopyMask( GetPortBitMapForCopyBits( sourcePort ) ,
+ GetPortBitMapForCopyBits( source->m_macMask ) ,
+ GetPortBitMapForCopyBits( m_macPort ) ,
+ &srcrect, &srcrect , &dstrect ) ;
+ UnlockPixels( GetGWorldPixMap( source->m_macMask ) ) ;
+ }
+ }
+ else
+ {
+ RgnHandle clipRgn = NewRgn() ;
+
+ LockPixels( GetGWorldPixMap( source->m_macMask ) ) ;
+ BitMapToRegion( clipRgn , (BitMap*) *GetGWorldPixMap( source->m_macMask ) ) ;
+ UnlockPixels( GetGWorldPixMap( source->m_macMask ) ) ;
+ //OffsetRgn( clipRgn , -source->m_macMask->portRect.left , -source->m_macMask->portRect.top ) ;
+ OffsetRgn( clipRgn , -srcrect.left + dstrect.left, -srcrect.top + dstrect.top ) ;
+ CopyBits( GetPortBitMapForCopyBits( sourcePort ) ,
+ GetPortBitMapForCopyBits( m_macPort ) ,
+ &srcrect, &dstrect, mode, clipRgn ) ;
+ DisposeRgn( clipRgn ) ;
+ }