Hopefully fixed misplaced printout in libgnomeprint.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43481 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -261,7 +261,6 @@ public:
|
|||||||
void DoGetSizeMM(int *width, int *height) const;
|
void DoGetSizeMM(int *width, int *height) const;
|
||||||
wxSize GetPPI() const;
|
wxSize GetPPI() const;
|
||||||
void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
||||||
void SetDeviceOrigin( wxCoord x, wxCoord y );
|
|
||||||
|
|
||||||
virtual int GetDepth() const { return 24; }
|
virtual int GetDepth() const { return 24; }
|
||||||
|
|
||||||
@@ -286,6 +285,8 @@ private:
|
|||||||
unsigned char m_currentRed;
|
unsigned char m_currentRed;
|
||||||
unsigned char m_currentGreen;
|
unsigned char m_currentGreen;
|
||||||
unsigned char m_currentBlue;
|
unsigned char m_currentBlue;
|
||||||
|
|
||||||
|
int m_deviceOffsetY;
|
||||||
|
|
||||||
wxGnomePrinter *m_printer;
|
wxGnomePrinter *m_printer;
|
||||||
GnomePrintContext *m_gpc;
|
GnomePrintContext *m_gpc;
|
||||||
@@ -304,7 +305,7 @@ private:
|
|||||||
}
|
}
|
||||||
wxCoord YDEV2LOG(wxCoord y) const
|
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 YDEV2LOGREL(wxCoord y) const
|
||||||
{
|
{
|
||||||
@@ -320,7 +321,7 @@ private:
|
|||||||
}
|
}
|
||||||
wxCoord YLOG2DEV(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
|
wxCoord YLOG2DEVREL(wxCoord y) const
|
||||||
{
|
{
|
||||||
|
@@ -736,7 +736,6 @@ bool wxGnomePrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt )
|
|||||||
int mw, mh;
|
int mw, mh;
|
||||||
dc->GetSizeMM(&mw, &mh);
|
dc->GetSizeMM(&mw, &mh);
|
||||||
printout->SetPageSizeMM((int)mw, (int)mh);
|
printout->SetPageSizeMM((int)mw, (int)mh);
|
||||||
|
|
||||||
printout->OnPreparePrinting();
|
printout->OnPreparePrinting();
|
||||||
|
|
||||||
// Get some parameters from the printout, if defined
|
// Get some parameters from the printout, if defined
|
||||||
@@ -854,6 +853,8 @@ wxGnomePrintDC::wxGnomePrintDC( wxGnomePrinter *printer )
|
|||||||
|
|
||||||
m_signX = 1; // default x-axis left to right
|
m_signX = 1; // default x-axis left to right
|
||||||
m_signY = -1; // default y-axis bottom up -> top down
|
m_signY = -1; // default y-axis bottom up -> top down
|
||||||
|
|
||||||
|
GetSize( NULL, &m_deviceOffsetY );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGnomePrintDC::wxGnomePrintDC( const wxPrintData& data )
|
wxGnomePrintDC::wxGnomePrintDC( const wxPrintData& data )
|
||||||
@@ -877,6 +878,8 @@ wxGnomePrintDC::wxGnomePrintDC( const wxPrintData& data )
|
|||||||
|
|
||||||
m_signX = 1; // default x-axis left to right
|
m_signX = 1; // default x-axis left to right
|
||||||
m_signY = -1; // default y-axis bottom up -> top down
|
m_signY = -1; // default y-axis bottom up -> top down
|
||||||
|
|
||||||
|
GetSize( NULL, &m_deviceOffsetY );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGnomePrintDC::~wxGnomePrintDC()
|
wxGnomePrintDC::~wxGnomePrintDC()
|
||||||
@@ -1669,8 +1672,6 @@ void wxGnomePrintDC::DestroyClippingRegion()
|
|||||||
|
|
||||||
bool wxGnomePrintDC::StartDoc(const wxString& message)
|
bool wxGnomePrintDC::StartDoc(const wxString& message)
|
||||||
{
|
{
|
||||||
SetDeviceOrigin( 0,0 );
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1782,7 +1783,6 @@ void wxGnomePrintDC::DoGetSize(int* width, int* height) const
|
|||||||
(wxGnomePrintNativeData*) m_printData.GetNativeData();
|
(wxGnomePrintNativeData*) m_printData.GetNativeData();
|
||||||
|
|
||||||
// Query page size. This seems to omit the margins
|
// Query page size. This seems to omit the margins
|
||||||
// right now, although it shouldn't
|
|
||||||
double pw,ph;
|
double pw,ph;
|
||||||
gs_lgp->gnome_print_job_get_page_size( native->GetPrintJob(), &pw, &ph );
|
gs_lgp->gnome_print_job_get_page_size( native->GetPrintJob(), &pw, &ph );
|
||||||
|
|
||||||
@@ -1828,15 +1828,6 @@ void wxGnomePrintDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
|
|||||||
ComputeScaleAndOrigin();
|
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)
|
void wxGnomePrintDC::SetResolution(int ppi)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user