From 8f0e43661ae6c0bfff35e46f60489df5d73f4957 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 30 Aug 2010 11:27:42 +0000 Subject: [PATCH] Fixed wrong line spacing calculation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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. -- 2.45.2