* Source/GSHorizontalTypesetter.m (_addExtraLineFragment): Make

sure curParagraphStyle and line_height always have useful values.
This commit is contained in:
fredkiefer 2020-05-09 17:16:47 +02:00
parent cad8383e62
commit 66ca536acc
2 changed files with 19 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2020-05-09 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSHorizontalTypesetter.m (_addExtraLineFragment): Make
sure curParagraphStyle and line_height always have useful values.
2020-05-08 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSWindow.m (-initWithContentRect:...defer:): Call

View file

@ -537,10 +537,22 @@ For bigger values the width gets ignored.
NSDictionary *typingAttributes = [curLayoutManager typingAttributes];
curParagraphStyle = [typingAttributes
objectForKey: NSParagraphStyleAttributeName];
if (curParagraphStyle == nil)
{
curParagraphStyle = [NSParagraphStyle defaultParagraphStyle];
}
curFont = [typingAttributes objectForKey: NSFontAttributeName];
}
line_height = [curFont defaultLineHeightForFont];
if (curFont)
{
line_height = [curFont defaultLineHeightForFont];
}
else
{
line_height = 15.0;
}
r = [self _getProposedRectFor: YES
withLineHeight: line_height];
r = [curTextContainer lineFragmentRectForProposedRect: r