// get the color of the pixel
COLORREF pixelcolor = ::GetPixel(GetHdc(), XLOG2DEV(x), YLOG2DEV(y));
+ // JACS: what was this for?
+#if 0
// get the color of the pen
COLORREF pencolor = 0x00ffffff;
if (m_pen.Ok())
{
pencolor = m_pen.GetColour().GetPixel();
}
+#endif
// return the color of the pixel
if( col )
// check, if color of the pixels is the same as the color of the current
// pen and return TRUE if it is, FALSE otherwise
- return pixelcolor == pencolor;
+ // JACS, 24/02/2000: can't understand the reason for this, so returning TRUE instead.
+ // return pixelcolor == pencolor;
+
+ return TRUE;
}
void wxDC::DoCrossHair(wxCoord x, wxCoord y)
(void)MoveToEx(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y1), NULL);
(void)LineTo(GetHdc(), XLOG2DEV(x2), YLOG2DEV(y2));
- // Normalization: Windows doesn't draw the last point of the line
- (void)LineTo(GetHdc(), XLOG2DEV(x2) + 1, YLOG2DEV(y2));
+ // Normalization: Windows doesn't draw the last point of the line.
+ // But apparently neither does GTK+, so we take it out again.
+// (void)LineTo(GetHdc(), XLOG2DEV(x2) + 1, YLOG2DEV(y2));
CalcBoundingBox(x1, y1);
CalcBoundingBox(x2, y2);
// In WIN16, draw a cross
HPEN blackPen = ::CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
HPEN whiteBrush = (HPEN)::GetStockObject(WHITE_BRUSH);
- HPEN hPenOld = (HPEN)::SelectObject(hdcMem, blackPen);
- HPEN hBrushOld = (HPEN)::SelectObject(hdcMem, whiteBrush);
+ HPEN hPenOld = (HPEN)::SelectObject(GetHdc(), blackPen);
+ HPEN hBrushOld = (HPEN)::SelectObject(GetHdc(), whiteBrush);
::SetROP2(GetHdc(), R2_COPYPEN);
Rectangle(GetHdc(), x1, y1, x2, y2);
MoveTo(GetHdc(), x1, y1);
wxCoord x2 = x + width;
wxCoord y2 = y + height;
- // Windows draws the filled rectangles without outline (i.e. drawn with a
- // transparent pen) one pixel smaller in both directions and we want them
- // to have the same size regardless of which pen is used - adjust
- if ( m_pen.GetStyle() == wxTRANSPARENT )
+ if ((m_logicalFunction == wxCOPY) && (m_pen.GetStyle() == wxTRANSPARENT))
{
- x2++;
- y2++;
+ RECT rect;
+ rect.left = XLOG2DEV(x);
+ rect.top = YLOG2DEV(y);
+ rect.right = XLOG2DEV(x2);
+ rect.bottom = YLOG2DEV(y2);
+ (void)FillRect(GetHdc(), &rect, (HBRUSH)m_brush.GetResourceHandle() );
+ }
+ else
+ {
+ // Windows draws the filled rectangles without outline (i.e. drawn with a
+ // transparent pen) one pixel smaller in both directions and we want them
+ // to have the same size regardless of which pen is used - adjust
+
+ // I wonder if this shouldn´t be done after the LOG2DEV() conversions. RR.
+ if ( m_pen.GetStyle() == wxTRANSPARENT )
+ {
+ x2++;
+ y2++;
+ }
+
+ (void)Rectangle(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
}
- (void)Rectangle(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2));
CalcBoundingBox(x, y);
CalcBoundingBox(x2, y2);