]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/printps.cpp
Patch from Neil H.
[wxWidgets.git] / src / generic / printps.cpp
index adf67bf80fd0c85e80795b4fb370aaceeba86241..36dbcac9a66b857ca48174e80b9d5bf4b1f8a7f4 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "wx/defs.h"
 
-#if wxUSE_PRINTING_ARCHITECTURE
+#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
 
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
@@ -56,7 +56,7 @@
 
     IMPLEMENT_DYNAMIC_CLASS(wxPostScriptPrinter, wxPrinterBase)
     IMPLEMENT_CLASS(wxPostScriptPrintPreview, wxPrintPreviewBase)
-
+    
 // ============================================================================
 // implementation
 // ============================================================================
@@ -151,8 +151,8 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro
     wxSize ScreenPixels = wxGetDisplaySize();
     wxSize ScreenMM = wxGetDisplaySizeMM();
 
-    printout->SetPPIScreen( (ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth(),
-                            (ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight() );
+    printout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()),
+                            (int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
     printout->SetPPIPrinter( wxPostScriptDC::GetResolution(),
                              wxPostScriptDC::GetResolution() );
 
@@ -339,8 +339,8 @@ void wxPostScriptPrintPreview::DetermineScaling()
         wxSize ScreenPixels = wxGetDisplaySize();
         wxSize ScreenMM = wxGetDisplaySizeMM();
 
-        m_previewPrintout->SetPPIScreen( (ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth(),
-                                         (ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight() );
+        m_previewPrintout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()),
+                                         (int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) );
         m_previewPrintout->SetPPIPrinter(wxPostScriptDC::GetResolution(), wxPostScriptDC::GetResolution()); 
 
         wxSize sizeDevUnits(paper->GetSizeDeviceUnits());