+
+#ifdef __WXMAC_OSX__
+ bool isCompositing = textctrl->MacGetTopLevelWindow()->MacUsesCompositing() ;
+ if ( m_sbHorizontal || m_sbVertical )
+ {
+ int w = bounds.right - bounds.left ;
+ int h = bounds.bottom - bounds.top ;
+
+ if ( m_sbHorizontal )
+ {
+ Rect sbBounds ;
+
+ sbBounds.left = -1 ;
+ sbBounds.top = h - 14 ;
+ sbBounds.right = w + 1 ;
+ sbBounds.bottom = h + 1 ;
+
+ if ( !isCompositing )
+ OffsetRect( &sbBounds , m_txnControlBounds.left , m_txnControlBounds.top ) ;
+
+ SetControlBounds( m_sbHorizontal , &sbBounds ) ;
+ SetControlViewSize( m_sbHorizontal , w ) ;
+ }
+ if ( m_sbVertical )
+ {
+ Rect sbBounds ;
+
+ sbBounds.left = w - 14 ;
+ sbBounds.top = -1 ;
+ sbBounds.right = w + 1 ;
+ sbBounds.bottom = m_sbHorizontal ? h - 14 : h + 1 ;
+
+ if ( !isCompositing )
+ OffsetRect( &sbBounds , m_txnControlBounds.left , m_txnControlBounds.top ) ;
+
+ SetControlBounds( m_sbVertical , &sbBounds ) ;
+ SetControlViewSize( m_sbVertical , h ) ;
+ }
+ }
+
+ Rect oldviewRect ;
+ TXNLongRect olddestRect ;
+ TXNGetRectBounds( m_txn , &oldviewRect , &olddestRect , NULL ) ;
+
+ Rect viewRect = { m_txnControlBounds.top, m_txnControlBounds.left,
+ m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ) } ;
+ TXNLongRect destRect = { m_txnControlBounds.top, m_txnControlBounds.left,
+ m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ) } ;
+
+ if ( olddestRect.right >= 10000 )
+ destRect.right = destRect.left + 32000 ;
+
+ if ( olddestRect.bottom >= 0x20000000 )
+ destRect.bottom = destRect.top + 0x40000000 ;
+
+ SectRect( &viewRect , &visBounds , &viewRect ) ;
+ TXNSetRectBounds( m_txn , &viewRect , &destRect , true ) ;
+/*
+ TXNSetFrameBounds( m_txn, m_txnControlBounds.top, m_txnControlBounds.left,
+ m_txnControlBounds.bottom - ( m_sbHorizontal ? 14 : 0 ) , m_txnControlBounds.right - ( m_sbVertical ? 14 : 0 ), m_txnFrameID);
+*/
+#else
+