void DoGetSizeMM(int *width, int *height) const;
wxSize GetPPI() const;
void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
- void SetDeviceOrigin( wxCoord x, wxCoord y );
virtual int GetDepth() const { return 24; }
unsigned char m_currentRed;
unsigned char m_currentGreen;
unsigned char m_currentBlue;
+
+ int m_deviceOffsetY;
wxGnomePrinter *m_printer;
GnomePrintContext *m_gpc;
}
wxCoord YDEV2LOG(wxCoord y) const
{
- return wxRound((double)(y - m_deviceOriginY) / m_scaleY) * m_signY + m_logicalOriginY;
+ return wxRound((double)(y + m_deviceOriginY - m_deviceOffsetY) / m_scaleY) * m_signY + m_logicalOriginY;
}
wxCoord YDEV2LOGREL(wxCoord y) const
{
}
wxCoord YLOG2DEV(wxCoord y) const
{
- return wxRound((double)(y - m_logicalOriginY) * m_scaleY) * m_signY + m_deviceOriginY;
+ return wxRound((double)(y - m_logicalOriginY) * m_scaleY) * m_signY - m_deviceOriginY + m_deviceOffsetY;
}
wxCoord YLOG2DEVREL(wxCoord y) const
{
int mw, mh;
dc->GetSizeMM(&mw, &mh);
printout->SetPageSizeMM((int)mw, (int)mh);
-
printout->OnPreparePrinting();
// Get some parameters from the printout, if defined
m_signX = 1; // default x-axis left to right
m_signY = -1; // default y-axis bottom up -> top down
+
+ GetSize( NULL, &m_deviceOffsetY );
}
wxGnomePrintDC::wxGnomePrintDC( const wxPrintData& data )
m_signX = 1; // default x-axis left to right
m_signY = -1; // default y-axis bottom up -> top down
+
+ GetSize( NULL, &m_deviceOffsetY );
}
wxGnomePrintDC::~wxGnomePrintDC()
bool wxGnomePrintDC::StartDoc(const wxString& message)
{
- SetDeviceOrigin( 0,0 );
-
return true;
}
(wxGnomePrintNativeData*) m_printData.GetNativeData();
// Query page size. This seems to omit the margins
- // right now, although it shouldn't
double pw,ph;
gs_lgp->gnome_print_job_get_page_size( native->GetPrintJob(), &pw, &ph );
ComputeScaleAndOrigin();
}
-void wxGnomePrintDC::SetDeviceOrigin( wxCoord x, wxCoord y )
-{
- int h = 0;
- int w = 0;
- GetSize( &w, &h );
-
- wxDC::SetDeviceOrigin( x, h-y );
-}
-
void wxGnomePrintDC::SetResolution(int ppi)
{
}