- // paint pixel by pixel
- for ( wxCoord srcX = 0; srcX < w; srcX++ )
- {
- for ( wxCoord srcY = 0; srcY < h; srcY++ )
- {
- // transform source coords to dest coords
- double r = sqrt((double)srcX*srcX + srcY*srcY);
- double angleOrig = atan2((double)srcY, (double)srcX) - rad;
- wxCoord dstX = (wxCoord)(r*cos(angleOrig) + 0.5),
- dstY = (wxCoord)(r*sin(angleOrig) + 0.5);
-
- // non-white pixel?
- bool textPixel = data[(srcY*w + srcX)*3] != 0xff;
- if ( textPixel || (m_backgroundMode == wxSOLID) )
- {
- // change colour if needed
- if ( textPixel != textColSet )
- {
- gdk_gc_set_foreground( m_textGC, textPixel ? colText
- : colBack );
-
- textColSet = textPixel;
- }
-
- // don't use DrawPoint() because it uses the current pen
- // colour, and we don't need it here
- gdk_draw_point( m_window, m_textGC,
- XLOG2DEV(x) + dstX, YLOG2DEV(y) + dstY );
- }
- }
- }