Implement wxGraphicsContext::GetSize() for Cairo.
As the implementation of this method is basically the same for all ports move it to the base class itself instead of requiring the derived classes to implement it. Now the derived classes need to fill in m_width and m_height members instead. Do fill them when creating wxGraphicsContext in Cairo version. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -503,7 +503,13 @@ public:
|
||||
virtual bool SetCompositionMode(wxCompositionMode op) = 0;
|
||||
|
||||
// returns the size of the graphics context in device coordinates
|
||||
virtual void GetSize( wxDouble* width, wxDouble* height);
|
||||
void GetSize(wxDouble* width, wxDouble* height)
|
||||
{
|
||||
if ( width )
|
||||
*width = m_width;
|
||||
if ( height )
|
||||
*height = m_height;
|
||||
}
|
||||
|
||||
// returns the resolution of the graphics context in device points per inch
|
||||
virtual void GetDPI( wxDouble* dpiX, wxDouble* dpiY);
|
||||
@@ -638,6 +644,9 @@ public:
|
||||
virtual bool ShouldOffset() const { return false; }
|
||||
|
||||
protected:
|
||||
// These fields must be initialized in the derived class ctors.
|
||||
wxDouble m_width,
|
||||
m_height;
|
||||
|
||||
wxGraphicsPen m_pen;
|
||||
wxGraphicsBrush m_brush;
|
||||
|
Reference in New Issue
Block a user