always initialize dc with map mode

svn: r2109
This commit is contained in:
Matthew Flatt 2006-02-03 19:37:57 +00:00
parent 0b83c1154f
commit f5dec47e4e

View File

@ -217,11 +217,15 @@ HDC wxDC::ThisDC(Bool flush_cache)
if (flush_cache) if (flush_cache)
ReleaseSelectedCache(); ReleaseSelectedCache();
if (canvas) wnd = (wxWnd *)canvas->handle;
if (cdc) if (cdc)
dc = cdc; dc = cdc;
else if (wnd) else {
if (canvas) {
wnd = (wxWnd *)canvas->handle;
if (wnd)
dc = wnd->GetHDC(); dc = wnd->GetHDC();
}
}
if (!old_pen) { if (!old_pen) {
HPEN op; HPEN op;
@ -230,6 +234,7 @@ HDC wxDC::ThisDC(Bool flush_cache)
old_pen = op; old_pen = op;
ob = (HBRUSH)::SelectObject(dc, null_brush); ob = (HBRUSH)::SelectObject(dc, null_brush);
old_brush = ob; old_brush = ob;
ResetMapMode(dc);
} }
return dc; return dc;
@ -1469,14 +1474,15 @@ void wxDC::DrawEllipse(double x, double y, double width, double height)
HDC dc; HDC dc;
int x1, y1, x2, y2; int x1, y1, x2, y2;
if (anti_alias) {
DrawArc(x, y, width, height, 0, 2 * wxPI);
return;
}
dc = ThisDC(); dc = ThisDC();
if (!dc) return; if (!dc) return;
if (anti_alias) {
DrawArc(x, y, width, height, 0, 2 * wxPI);
return;
} else
ReleaseGraphics(dc); ReleaseGraphics(dc);
if (StippleBrush()) { if (StippleBrush()) {