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:
parent
76fd05b147
commit
8bad0e494f
@ -157,10 +157,6 @@ public:
|
||||
|
||||
wxDouble GetWidth() const { return m_width; }
|
||||
|
||||
// This is a helper used by wxWidgets itself, it doesn't make much sense to
|
||||
// use it outside of the library.
|
||||
static wxGraphicsPenInfo CreateFromPen(const wxPen& pen);
|
||||
|
||||
private:
|
||||
wxDouble m_width;
|
||||
};
|
||||
@ -512,8 +508,7 @@ public:
|
||||
|
||||
wxGraphicsPath CreatePath() const;
|
||||
|
||||
wxGraphicsPen CreatePen(const wxPen& pen) const
|
||||
{ return DoCreatePen(wxGraphicsPenInfo::CreateFromPen(pen)); }
|
||||
wxGraphicsPen CreatePen(const wxPen& pen) const;
|
||||
|
||||
wxGraphicsPen CreatePen(const wxGraphicsPenInfo& info) const
|
||||
{ return DoCreatePen(info); }
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user