virtual bool ShouldOffset() const
{
+ if ( !m_enableOffset )
+ return false;
+
int penwidth = 0 ;
if ( !m_pen.IsNull() )
{
const wxDCImpl *impl = dc.GetImpl();
Init( (cairo_t*) impl->GetCairoContext() );
+ wxSize sz = dc.GetSize();
+ m_width = sz.x;
+ m_height = sz.y;
+
wxPoint org = dc.GetDeviceOrigin();
cairo_translate( m_context, org.x, org.y );
wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxWindowDC& dc )
: wxGraphicsContext(renderer)
{
+ int width, height;
+ dc.GetSize( &width, &height );
+ m_width = width;
+ m_height = height;
+
+ m_enableOffset = true;
+
#ifdef __WXGTK20__
wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
Init( gdk_cairo_create( impldc->GetGDKWindow() ) );
#endif
#ifdef __WXMAC__
- int width, height;
- dc.GetSize( &width, &height );
CGContextRef cgcontext = (CGContextRef)dc.GetWindow()->MacGetCGContextRef();
cairo_surface_t* surface = cairo_quartz_surface_create_for_cg_context(cgcontext, width, height);
Init( cairo_create( surface ) );
wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxMemoryDC& dc )
: wxGraphicsContext(renderer)
{
+ int width, height;
+ dc.GetSize( &width, &height );
+ m_width = width;
+ m_height = height;
+
+ m_enableOffset = true;
+
#ifdef __WXGTK20__
wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
Init( gdk_cairo_create( impldc->GetGDKWindow() ) );
#endif
#ifdef __WXMAC__
- int width, height;
- dc.GetSize( &width, &height );
CGContextRef cgcontext = (CGContextRef)dc.GetWindow()->MacGetCGContextRef();
cairo_surface_t* surface = cairo_quartz_surface_create_for_cg_context(cgcontext, width, height);
Init( cairo_create( surface ) );
: wxGraphicsContext(renderer)
{
Init( gdk_cairo_create( drawable ) );
+
+ int width, height;
+ gdk_drawable_get_size( drawable, &width, &height );
+ m_width = width;
+ m_height = height;
}
#endif
: wxGraphicsContext(renderer)
{
m_mswSurface = cairo_win32_surface_create(handle);
- m_context = cairo_create(m_mswSurface);
- PushState();
- PushState();
+ Init( cairo_create(m_mswSurface) );
+ m_width =
+ m_height = 0;
}
#endif
: wxGraphicsContext(renderer)
{
Init( context );
+ m_width =
+ m_height = 0;
}
wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, wxWindow *window)
: wxGraphicsContext(renderer)
{
+ m_enableOffset = true;
#ifdef __WXGTK__
// something along these lines (copied from dcclient)
wxASSERT_MSG( window->m_wxwindow, wxT("wxCairoContext needs a widget") );
Init(gdk_cairo_create(window->GTKGetDrawingWindow()));
+
+ wxSize sz = window->GetSize();
+ m_width = sz.x;
+ m_height = sz.y;
#endif
}