Don't reset wxGraphicsContext attributes in wxGCDC ctor from it
When creating wxGCDC from an existing wxGraphicsContext, it is better to keep using the attributes (such as font, pen, brush) already configured for it rather than overwriting them with the default values, which is not very useful, unlike the new behaviour, which allows to configure wxGraphicsContext using features not supported by wxDC API (e.g. alpha channel for pens/brushes) and then use it via wxDC API only (allowing the existing legacy code to use alpha, for example).
This commit is contained in:
committed by
Vadim Zeitlin
parent
0338ad5124
commit
af6e478182
@@ -124,7 +124,17 @@ wxIMPLEMENT_ABSTRACT_CLASS(wxGCDCImpl, wxDCImpl);
|
||||
wxGCDCImpl::wxGCDCImpl(wxDC *owner, wxGraphicsContext* context) :
|
||||
wxDCImpl(owner)
|
||||
{
|
||||
Init(context);
|
||||
CommonInit();
|
||||
|
||||
m_graphicContext = context;
|
||||
m_ok = m_graphicContext != NULL;
|
||||
|
||||
// We can't currently initialize m_font, m_pen and m_brush here as we don't
|
||||
// have any way of converting the corresponding wxGraphicsXXX objects to
|
||||
// plain wxXXX ones. This is obviously not ideal as it means that GetXXX()
|
||||
// won't return the actual object being used, but is better than the only
|
||||
// alternative which is overwriting the objects currently used in the
|
||||
// graphics context with the defaults.
|
||||
}
|
||||
|
||||
wxGCDCImpl::wxGCDCImpl( wxDC *owner ) :
|
||||
|
Reference in New Issue
Block a user