- m_surface->DrawLine(XLOG2DEV(x1), YLOG2DEV(y1),
- XLOG2DEV(x2), YLOG2DEV(y2));
+ wxCoord xx1 = XLOG2DEV(x1);
+ wxCoord yy1 = YLOG2DEV(y1);
+ wxCoord xx2 = XLOG2DEV(x2);
+ wxCoord yy2 = YLOG2DEV(y2);
+
+ // FIXME: DrawLine() shouldn't draw the last pixel, but DFB's DrawLine()
+ // does draw it. We should undo any change to the last pixel by
+ // using GetPixel() and PutPixel(), but until they are implemented,
+ // handle at least the special case of vertical and horizontal
+ // lines correctly:
+ if ( xx1 == xx2 )
+ {
+ if ( yy1 < yy2 )
+ yy2--;
+ else if ( yy1 > yy2 )
+ yy2++;
+ }
+ if ( yy1 == yy2 )
+ {
+ if ( xx1 < xx2 )
+ xx2--;
+ else if ( xx1 > xx2 )
+ xx2++;
+ }
+
+ m_surface->DrawLine(xx1, yy1, xx2, yy2);