diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp index 7e91cdb306..817a4311e3 100644 --- a/src/common/graphcmn.cpp +++ b/src/common/graphcmn.cpp @@ -836,12 +836,18 @@ wxGraphicsPen wxGraphicsContext::CreatePen(const wxPen& pen) const .Cap(pen.GetCap()) ; - wxDash *dashes; - if ( int nb_dashes = pen.GetDashes(&dashes) ) - info.Dashes(nb_dashes, dashes); + if ( info.GetStyle() == wxPENSTYLE_USER_DASH ) + { + wxDash *dashes; + if ( int nb_dashes = pen.GetDashes(&dashes) ) + info.Dashes(nb_dashes, dashes); + } - if ( wxBitmap* const stipple = pen.GetStipple() ) - info.Stipple(*stipple); + if ( info.GetStyle() == wxPENSTYLE_STIPPLE ) + { + if ( wxBitmap* const stipple = pen.GetStipple() ) + info.Stipple(*stipple); + } return DoCreatePen(info); }