]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
Interface fixes and tweaks for Phoenix
[wxWidgets.git] / src / msw / textctrl.cpp
index 4792c8de81208969ee4a5abaa8e67205dd5f37b4..d62b8ab16167afdab64993b4ba9d88a2921f4b40 100644 (file)
@@ -30,6 +30,7 @@
     #include "wx/textctrl.h"
     #include "wx/settings.h"
     #include "wx/brush.h"
     #include "wx/textctrl.h"
     #include "wx/settings.h"
     #include "wx/brush.h"
+    #include "wx/dcclient.h"
     #include "wx/utils.h"
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/utils.h"
     #include "wx/intl.h"
     #include "wx/log.h"
@@ -2740,7 +2741,10 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
 
 
     LOGFONT lf;
 
 
     LOGFONT lf;
-    lf.lfHeight = cf.yHeight;
+    // Convert the height from the units of 1/20th of the point in which
+    // CHARFORMAT stores it to pixel-based units used by LOGFONT.
+    const wxCoord ppi = wxClientDC(this).GetPPI().y;
+    lf.lfHeight = -MulDiv(cf.yHeight/2, ppi, 72);
     lf.lfWidth = 0;
     lf.lfCharSet = ANSI_CHARSET; // FIXME: how to get correct charset?
     lf.lfClipPrecision = 0;
     lf.lfWidth = 0;
     lf.lfCharSet = ANSI_CHARSET; // FIXME: how to get correct charset?
     lf.lfClipPrecision = 0;