#include "wx/dcmemory.h"
#include "wx/defs.h"
-#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
-#endif
//-----------------------------------------------------------------------------
// constants
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
{
- m_externalDeviceOriginX = x;
- m_externalDeviceOriginY = y;
+ // only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there
+ m_deviceOriginX = x;
+ m_deviceOriginY = y;
ComputeScaleAndOrigin();
}
-void wxDC::SetInternalDeviceOrigin( wxCoord x, wxCoord y )
-{
- m_internalDeviceOriginX = x;
- m_internalDeviceOriginY = y;
- ComputeScaleAndOrigin();
-}
-
-void wxDC::GetInternalDeviceOrigin( wxCoord *x, wxCoord *y )
-{
- if (x) *x = m_internalDeviceOriginX;
- if (y) *y = m_internalDeviceOriginY;
-}
-
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
{
m_signX = xLeftRight ? 1 : -1;
void wxDC::ComputeScaleAndOrigin()
{
- // CMB: copy scale to see if it changes
- double origScaleX = m_scaleX;
- double origScaleY = m_scaleY;
-
m_scaleX = m_logicalScaleX * m_userScaleX;
m_scaleY = m_logicalScaleY * m_userScaleY;
-
- m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
- m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
-
- // CMB: if scale has changed call SetPen to recalulate the line width
- if (m_scaleX != origScaleX || m_scaleY != origScaleY)
- {
- // this is a bit artificial, but we need to force wxDC to think
- // the pen has changed
- wxPen* pen = & GetPen();
- wxPen tempPen;
- m_pen = tempPen;
- SetPen(* pen);
- }
}