Made device to logical and vv conversion methods
virtual and implement them like any other method in the wxDC classes, not only in the their files but somehow belonging to the wxDCBase class. This is required for plugging in differnt DC backends with different conversions. Ideally (and absolutely possible ) all these methods should be removed and just the one in wxDCBase should stay using values set in the various derived classes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,43 +25,6 @@
|
||||
#define MM_METRIC 7
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// coordinates transformations
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
inline wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
|
||||
{
|
||||
return wxRound((x - m_deviceOriginX) / m_scaleX) * m_signX + m_logicalOriginX;
|
||||
}
|
||||
inline wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
|
||||
{
|
||||
return wxRound((y - m_deviceOriginY) / m_scaleY) * m_signY + m_logicalOriginY;
|
||||
}
|
||||
inline wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
|
||||
{
|
||||
return wxRound(x / m_scaleX);
|
||||
}
|
||||
inline wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
|
||||
{
|
||||
return wxRound(y / m_scaleY);
|
||||
}
|
||||
inline wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
|
||||
{
|
||||
return wxRound((x - m_logicalOriginX) * m_scaleX) * m_signX + m_deviceOriginX;
|
||||
}
|
||||
inline wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
|
||||
{
|
||||
return wxRound((y - m_logicalOriginY) * m_scaleY) * m_signY + m_deviceOriginY;
|
||||
}
|
||||
inline wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
|
||||
{
|
||||
return wxRound(x * m_scaleX);
|
||||
}
|
||||
inline wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
||||
{
|
||||
return wxRound(y * m_scaleY);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDC
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -84,6 +47,15 @@ public:
|
||||
virtual void StartPage() { }
|
||||
virtual void EndPage() { }
|
||||
|
||||
virtual wxCoord DeviceToLogicalX(wxCoord x) const;
|
||||
virtual wxCoord DeviceToLogicalY(wxCoord y) const;
|
||||
virtual wxCoord DeviceToLogicalXRel(wxCoord x) const;
|
||||
virtual wxCoord DeviceToLogicalYRel(wxCoord y) const;
|
||||
virtual wxCoord LogicalToDeviceX(wxCoord x) const;
|
||||
virtual wxCoord LogicalToDeviceY(wxCoord y) const;
|
||||
virtual wxCoord LogicalToDeviceXRel(wxCoord x) const;
|
||||
virtual wxCoord LogicalToDeviceYRel(wxCoord y) const ;
|
||||
|
||||
virtual void SetMapMode( int mode );
|
||||
virtual void SetUserScale( double x, double y );
|
||||
virtual void SetLogicalScale( double x, double y );
|
||||
|
Reference in New Issue
Block a user