Add wxDC::SetTransformMatrix() and related methods and implement them in wxMSW.
Add support for world transformations to wxDC too. Currently this is implemented in wxMSW only but could be easily provided in the ports that use wxGraphicsContext for wxDC implementation later. Closes #13092. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "wx/math.h"
|
||||
#include "wx/image.h"
|
||||
#include "wx/region.h"
|
||||
#include "wx/affinematrix2d.h"
|
||||
|
||||
#define wxUSE_NEW_DC 1
|
||||
|
||||
@@ -490,6 +491,20 @@ public:
|
||||
if ( y ) *y = m_deviceOriginY;
|
||||
}
|
||||
|
||||
#if wxUSE_DC_TRANSFORM_MATRIX
|
||||
// Transform matrix support is not available in most ports right now
|
||||
// (currently only wxMSW provides it) so do nothing in these methods by
|
||||
// default.
|
||||
virtual bool CanUseTransformMatrix() const
|
||||
{ return false; }
|
||||
virtual bool SetTransformMatrix(const wxAffineMatrix2D& WXUNUSED(matrix))
|
||||
{ return false; }
|
||||
virtual wxAffineMatrix2D GetTransformMatrix() const
|
||||
{ return wxAffineMatrix2D(); }
|
||||
virtual void ResetTransformMatrix()
|
||||
{ }
|
||||
#endif // wxUSE_DC_TRANSFORM_MATRIX
|
||||
|
||||
virtual void SetDeviceLocalOrigin( wxCoord x, wxCoord y );
|
||||
|
||||
virtual void ComputeScaleAndOrigin();
|
||||
@@ -1001,6 +1016,20 @@ public:
|
||||
void SetAxisOrientation(bool xLeftRight, bool yBottomUp)
|
||||
{ m_pimpl->SetAxisOrientation(xLeftRight, yBottomUp); }
|
||||
|
||||
#if wxUSE_DC_TRANSFORM_MATRIX
|
||||
bool CanUseTransformMatrix() const
|
||||
{ return m_pimpl->CanUseTransformMatrix(); }
|
||||
|
||||
bool SetTransformMatrix(const wxAffineMatrix2D &matrix)
|
||||
{ return m_pimpl->SetTransformMatrix(matrix); }
|
||||
|
||||
wxAffineMatrix2D GetTransformMatrix() const
|
||||
{ return m_pimpl->GetTransformMatrix(); }
|
||||
|
||||
void ResetTransformMatrix()
|
||||
{ m_pimpl->ResetTransformMatrix(); }
|
||||
#endif // wxUSE_DC_TRANSFORM_MATRIX
|
||||
|
||||
// mostly internal
|
||||
void SetDeviceLocalOrigin( wxCoord x, wxCoord y )
|
||||
{ m_pimpl->SetDeviceLocalOrigin( x, y ); }
|
||||
|
Reference in New Issue
Block a user