+ wxMemoryDC* srcDC = (wxMemoryDC*)source;
+ GdkPixmap* pmap = srcDC->m_selected.GetPixmap();
+ if (pmap)
+ {
+ long xx = XLOG2DEV(xdest);
+ long yy = YLOG2DEV(ydest);
+
+ GdkBitmap *mask = (GdkBitmap *) NULL;
+ if (srcDC->m_selected.GetMask()) mask = srcDC->m_selected.GetMask()->GetBitmap();
+
+ if (useMask && mask)
+ {
+ gdk_gc_set_clip_mask( m_textGC, mask );
+ gdk_gc_set_clip_origin( m_textGC, xx, yy );
+ }
+
+ gdk_draw_pixmap( m_window, m_textGC, pmap,
+ source->DeviceToLogicalX(xsrc),
+ source->DeviceToLogicalY(ysrc),
+ xx,
+ yy,
+ source->DeviceToLogicalXRel(width),
+ source->DeviceToLogicalYRel(height) );
+
+ if (useMask && mask)
+ {
+ gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
+ gdk_gc_set_clip_origin( m_textGC, 0, 0 );
+ }
+
+ return TRUE;
+ }
+
+ GdkBitmap* bmap = srcDC->m_selected.GetBitmap();
+ if (bmap)
+ {
+ long xx = XLOG2DEV(xdest);
+ long yy = YLOG2DEV(ydest);
+
+ GdkBitmap *mask = (GdkBitmap *) NULL;
+ if (srcDC->m_selected.GetMask()) mask = srcDC->m_selected.GetMask()->GetBitmap();
+
+ if (useMask && mask)
+ {
+ gdk_gc_set_clip_mask( m_textGC, mask );
+ gdk_gc_set_clip_origin( m_textGC, xx, yy );
+ }
+
+ gdk_draw_bitmap( m_window, m_textGC, bmap,
+ source->DeviceToLogicalX(xsrc),
+ source->DeviceToLogicalY(ysrc),
+ xx,
+ yy,
+ source->DeviceToLogicalXRel(width),
+ source->DeviceToLogicalYRel(height) );
+
+ if (useMask && mask)
+ {
+ gdk_gc_set_clip_mask( m_textGC, (GdkBitmap *) NULL );
+ gdk_gc_set_clip_origin( m_textGC, 0, 0 );
+ }
+
+ return TRUE;
+ }