]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/fontdlgg.cpp
update frm Ivan Masar
[wxWidgets.git] / src / generic / fontdlgg.cpp
index 175954049b4b98afb8fb0d78eb887145d56611b0..66191c4993cd1bf4430819adf8cc8ead83049a7e 100644 (file)
@@ -79,13 +79,10 @@ void wxFontPreviewer::OnPaint(wxPaintEvent& WXUNUSED(event))
     if ( font.Ok() )
     {
         dc.SetFont(font);
-        // Calculate vertical centre
-        long w = 0, h = 0;
-        dc.GetTextExtent( wxT("X"), &w, &h);
         dc.SetTextForeground(GetForegroundColour());
         dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
         dc.DrawText(_("ABCDEFGabcdefg12345"),
-                     10, size.y/2 - h/2);
+                     10, (size.y - dc.GetTextExtent(wxT("X")).y)/2);
         dc.DestroyClippingRegion();
     }
 }