Search for font instead of creating it each time
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4678,10 +4678,14 @@ bool wxRichTextParagraph::Layout(wxDC& dc, wxRichTextDrawingContext& context, co
|
|||||||
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.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.GetFont().IsOk())
|
if (attr.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.HasFont())
|
||||||
{
|
{
|
||||||
wxCheckSetFont(dc, attr.GetFont());
|
wxFont font(buffer->GetFontTable().FindFont(attr));
|
||||||
lineSpacing = (int) (double(dc.GetCharHeight()) * (double(attr.GetLineSpacing())/10.0 - 1.0));
|
if (font.IsOk())
|
||||||
|
{
|
||||||
|
wxCheckSetFont(dc, font);
|
||||||
|
lineSpacing = (int) (double(dc.GetCharHeight()) * (double(attr.GetLineSpacing())/10.0 - 1.0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start position for each line relative to the paragraph
|
// Start position for each line relative to the paragraph
|
||||||
|
Reference in New Issue
Block a user