]> git.saurik.com Git - wxWidgets.git/commitdiff
Corrected scale factor for the use of DC PPI instead of printer PPI in wxRTC code
authorJulian Smart <julian@anthemion.co.uk>
Mon, 26 Mar 2012 16:57:05 +0000 (16:57 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 26 Mar 2012 16:57:05 +0000 (16:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextprint.cpp

index cc4714cdd3fdd458986c4d323870f39d25f6a709..55c0dbf8cfb6485eb9924dfa6b16ad7f6b0f259b 100644 (file)
@@ -345,8 +345,8 @@ void wxRichTextPrintout::CalculateScaling(wxDC* dc, wxRect& textRect, wxRect& he
 
     // The dimensions used for indentation etc. have to be unscaled
     // during printing to be correct when scaling is applied.
-    // if (!IsPreview())
-        m_richTextBuffer->SetScale(scale);
+    // Also, correct the conversions in wxRTC using DC instead of print DC.
+    m_richTextBuffer->SetScale(scale * float(dc->GetPPI().x)/float(ppiPrinterX));
 
     // Calculate margins
     int marginLeft = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_marginLeft);