#include "wx/paper.h"
#include <gtk/gtk.h>
+
+#if GTK_CHECK_VERSION(2,14,0)
+#include <gtk/gtkunixprint.h>
+#else
#include <gtk/gtkpagesetupunixdialog.h>
+#endif
+
#if wxUSE_GRAPHICS_CONTEXT
#include "wx/graphics.h"
if (paper)
{
- m_previewPrintout->SetPPIScreen(wxGetDisplayPPI());
- m_previewPrintout->SetPPIPrinter( m_resolution, m_resolution );
+ const wxSize screenPPI = wxGetDisplayPPI();
+ int logPPIScreenX = screenPPI.GetWidth();
+ int logPPIScreenY = screenPPI.GetHeight();
+ int logPPIPrinterX = m_resolution;
+ int logPPIPrinterY = m_resolution;
+
+ m_previewPrintout->SetPPIScreen( logPPIScreenX, logPPIScreenY );
+ m_previewPrintout->SetPPIPrinter( logPPIPrinterX, logPPIPrinterY );
// Get width and height in points (1/72th of an inch)
wxSize sizeDevUnits(paper->GetSizeDeviceUnits());
m_previewPrintout->SetPaperRectPixels(wxRect(0, 0, m_pageWidth, m_pageHeight));
// At 100%, the page should look about page-size on the screen.
- m_previewScaleX = 0.8 * 72.0 / (double)m_resolution;
- m_previewScaleY = m_previewScaleX;
+ m_previewScaleX = float(logPPIScreenX) / logPPIPrinterX;
+ m_previewScaleY = float(logPPIScreenY) / logPPIPrinterY;
}
}