From 45c6df33eccc9c91df7057dbb57dee38b418d906 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Aug 2008 22:51:31 +0000 Subject: [PATCH] make ellipses drawn by wxDC more consistent with wxGC ones (closes #9887) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55163 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dc.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 5a8608840b..c912e076aa 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1074,10 +1074,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); -- 2.50.0