X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fdaad94e75273fa586ec9af9d53518222f9699d0..29dbfacee2a6bc6978d6224efea9a31a1a5a2649:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 5a8608840b..d878f66645 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -399,6 +399,16 @@ wxBrushAttrsSetter::wxBrushAttrsSetter(wxMSWDCImpl& dc) } } +// ---------------------------------------------------------------------------- +// wxDC MSW-specific methods +// ---------------------------------------------------------------------------- + +WXHDC wxDC::GetHDC() const +{ + wxMSWDCImpl * const impl = wxDynamicCast(GetImpl(), wxMSWDCImpl); + return impl ? impl->GetHDC() : 0; +} + // --------------------------------------------------------------------------- // wxMSWDCImpl // --------------------------------------------------------------------------- @@ -1074,10 +1084,15 @@ void wxMSWDCImpl::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord hei wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling - wxCoord x2 = (x+width); - wxCoord y2 = (y+height); + // +1 below makes the ellipse more similar to other platforms. + // In particular, DoDrawEllipse(x,y,1,1) should draw one point. + wxCoord x2 = x + width + 1; + wxCoord y2 = y + height + 1; + + // Problem: Windows GDI Ellipse() with x2-x == y2-y == 3 and transparent + // pen doesn't draw anything. Should we provide a workaround? - (void)Ellipse(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2)); + ::Ellipse(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2), YLOG2DEV(y2)); CalcBoundingBox(x, y); CalcBoundingBox(x2, y2);