Fixed wrong line spacing calculation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2010-08-30 11:27:42 +00:00
parent 602a592c22
commit 8f0e43661a

View File

@@ -3338,11 +3338,10 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style)
int lineSpacing = 0; int lineSpacing = 0;
// Let's assume line spacing of 10 is normal, 15 is 1.5, 20 is 2, etc. // Let's assume line spacing of 10 is normal, 15 is 1.5, 20 is 2, etc.
if (attr.GetLineSpacing() != 10 && GetBuffer()) if (attr.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.GetFont().Ok())
{ {
wxFont font(GetBuffer()->GetFontTable().FindFont(attr)); wxCheckSetFont(dc, attr.GetFont());
wxCheckSetFont(dc, font); lineSpacing = (int) (double(dc.GetCharHeight()) * (double(attr.GetLineSpacing())/10.0 - 1.0));
lineSpacing = (ConvertTenthsMMToPixels(dc, dc.GetCharHeight()) * attr.GetLineSpacing())/10;
} }
// Available space for text on each line differs. // Available space for text on each line differs.