Get rid of wxGraphicsPenInfo::CreateFromPen()
This is a helper method used only in wxWidgets itself and only once, so just inline it at the point of use to avoid exporting an unnecessary function in the public API.
This commit is contained in:
@@ -117,24 +117,6 @@ WXDLLIMPEXP_DATA_CORE(wxGraphicsBrush) wxNullGraphicsBrush;
|
||||
WXDLLIMPEXP_DATA_CORE(wxGraphicsFont) wxNullGraphicsFont;
|
||||
WXDLLIMPEXP_DATA_CORE(wxGraphicsBitmap) wxNullGraphicsBitmap;
|
||||
|
||||
/* static */
|
||||
wxGraphicsPenInfo wxGraphicsPenInfo::CreateFromPen(const wxPen& pen)
|
||||
{
|
||||
if ( !pen.IsOk() )
|
||||
return wxGraphicsPenInfo().Style(wxPENSTYLE_TRANSPARENT);
|
||||
|
||||
wxDash *dashes;
|
||||
int nb_dashes = pen.GetDashes(&dashes);
|
||||
return wxGraphicsPenInfo()
|
||||
.Colour(pen.GetColour())
|
||||
.Width(pen.GetWidth())
|
||||
.Style(pen.GetStyle())
|
||||
.Stipple(*pen.GetStipple())
|
||||
.Dashes(nb_dashes, dashes)
|
||||
.Join(pen.GetJoin())
|
||||
.Cap(pen.GetCap());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// matrix
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -841,6 +823,24 @@ wxGraphicsPath wxGraphicsContext::CreatePath() const
|
||||
return GetRenderer()->CreatePath();
|
||||
}
|
||||
|
||||
wxGraphicsPen wxGraphicsContext::CreatePen(const wxPen& pen) const
|
||||
{
|
||||
if ( !pen.IsOk() )
|
||||
return wxGraphicsPen();
|
||||
|
||||
wxDash *dashes;
|
||||
int nb_dashes = pen.GetDashes(&dashes);
|
||||
|
||||
return DoCreatePen(wxGraphicsPenInfo()
|
||||
.Colour(pen.GetColour())
|
||||
.Width(pen.GetWidth())
|
||||
.Style(pen.GetStyle())
|
||||
.Stipple(*pen.GetStipple())
|
||||
.Dashes(nb_dashes, dashes)
|
||||
.Join(pen.GetJoin())
|
||||
.Cap(pen.GetCap()));
|
||||
}
|
||||
|
||||
wxGraphicsPen wxGraphicsContext::DoCreatePen(const wxGraphicsPenInfo& info) const
|
||||
{
|
||||
return GetRenderer()->CreatePen(info);
|
||||
|
||||
Reference in New Issue
Block a user