diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index fb45e814cd..0a46f82d00 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -3338,11 +3338,10 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style) int lineSpacing = 0; // 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, font); - lineSpacing = (ConvertTenthsMMToPixels(dc, dc.GetCharHeight()) * attr.GetLineSpacing())/10; + wxCheckSetFont(dc, attr.GetFont()); + lineSpacing = (int) (double(dc.GetCharHeight()) * (double(attr.GetLineSpacing())/10.0 - 1.0)); } // Available space for text on each line differs.