X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c0e710f008370d8c0039b3aa859b8eb65d6de12..7198c3368055d88249a338eb33b21f051f674806:/src/common/dcgraph.cpp diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index ab615e482f..a06cd25382 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -114,6 +114,13 @@ wxGCDC::wxGCDC( const wxPrinterDC& dc) : } #endif +#if defined(__WXMSW__) && wxUSE_ENH_METAFILE +wxGCDC::wxGCDC(const wxEnhMetaFileDC& dc) + : wxDC(new wxGCDCImpl(this, dc)) +{ +} +#endif + wxGCDC::wxGCDC() : wxDC( new wxGCDCImpl( this ) ) { @@ -193,6 +200,15 @@ wxGCDCImpl::wxGCDCImpl( wxDC *owner, const wxPrinterDC& dc ) : } #endif +#if defined(__WXMSW__) && wxUSE_ENH_METAFILE +wxGCDCImpl::wxGCDCImpl(wxDC *owner, const wxEnhMetaFileDC& dc) + : wxDCImpl(owner) +{ + Init(); + SetGraphicsContext(wxGraphicsContext::Create(dc)); +} +#endif + void wxGCDCImpl::Init() { m_ok = false; @@ -1156,4 +1172,21 @@ void wxGCDCImpl::DoDrawCheckMark(wxCoord x, wxCoord y, wxDCImpl::DoDrawCheckMark(x,y,width,height); } +#ifdef __WXMSW__ +wxRect wxGCDCImpl::MSWApplyGDIPlusTransform(const wxRect& r) const +{ + wxGraphicsContext* const gc = GetGraphicsContext(); + wxCHECK_MSG( gc, r, wxT("Invalid wxGCDC") ); + + double x = 0, + y = 0; + gc->GetTransform().TransformPoint(&x, &y); + + wxRect rect(r); + rect.Offset(x, y); + + return rect; +} +#endif // __WXMSW__ + #endif // wxUSE_GRAPHICS_CONTEXT