Use native methods to draw some geometric figures using GDI+ renderer
Use native methods provided by GDI+ renderer to draw circles and ellipses. Closes #17554
This commit is contained in:
@@ -155,15 +155,18 @@ public :
|
||||
//
|
||||
|
||||
// appends a rectangle as a new closed subpath
|
||||
virtual void AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) ;
|
||||
virtual void AddRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h) wxOVERRIDE;
|
||||
|
||||
// appends a circle as a new closed subpath
|
||||
virtual void AddCircle(wxDouble x, wxDouble y, wxDouble r) wxOVERRIDE;
|
||||
|
||||
// appends an ellipse as a new closed subpath fitting the passed rectangle
|
||||
virtual void AddEllipse(wxDouble x, wxDouble y, wxDouble w, wxDouble h) wxOVERRIDE;
|
||||
|
||||
/*
|
||||
|
||||
// appends an ellipsis as a new closed subpath fitting the passed rectangle
|
||||
virtual void AddEllipsis( wxDouble x, wxDouble y, wxDouble w , wxDouble h ) ;
|
||||
|
||||
// draws a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1)
|
||||
virtual void AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r ) ;
|
||||
*/
|
||||
*/
|
||||
|
||||
// returns the native path
|
||||
virtual void * GetNativePath() const { return m_path; }
|
||||
@@ -1324,6 +1327,16 @@ void wxGDIPlusPathData::AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDoub
|
||||
MoveToPoint(x, y);
|
||||
}
|
||||
|
||||
void wxGDIPlusPathData::AddCircle(wxDouble x, wxDouble y, wxDouble r)
|
||||
{
|
||||
m_path->AddEllipse((REAL)(x-r), (REAL)(y-r), (REAL)(2.0*r), (REAL)(2.0*r));
|
||||
}
|
||||
|
||||
void wxGDIPlusPathData::AddEllipse(wxDouble x, wxDouble y, wxDouble w, wxDouble h)
|
||||
{
|
||||
m_path->AddEllipse((REAL)x, (REAL)y, (REAL)w, (REAL)h);
|
||||
}
|
||||
|
||||
void wxGDIPlusPathData::AddPath( const wxGraphicsPathData* path )
|
||||
{
|
||||
const wxGDIPlusPathData* pathData = static_cast<const wxGDIPlusPathData*>(path);
|
||||
|
Reference in New Issue
Block a user