mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
* Source/GSHorizontalTypesetter.m: (_addExtraLineFragment) get paragraph style and
font from NSLayoutManager's typing attributes. Fixes insertion point height for empty text objects (NSTextView, NSTexField etc.).
This commit is contained in:
parent
76d6047d56
commit
5415783c56
2 changed files with 22 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2019-12-10 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Source/GSHorizontalTypesetter.m: (_addExtraLineFragment) get paragraph style and
|
||||
font from NSLayoutManager's typing attributes. Fixes insertion point height for empty
|
||||
text objects (NSTextView, NSTexField etc.).
|
||||
|
||||
2019-12-09 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Source/NSStringDrawing.m: fixed incorrect string drawing (shortened, misplaced)
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
#import "AppKit/NSTextAttachment.h"
|
||||
#import "AppKit/NSTextContainer.h"
|
||||
#import "AppKit/NSTextStorage.h"
|
||||
#import "AppKit/NSLayoutManager.h"
|
||||
#import "AppKit/NSTextView.h"
|
||||
#import "GNUstepGUI/GSLayoutManager.h"
|
||||
#import "GNUstepGUI/GSHorizontalTypesetter.h"
|
||||
|
||||
|
@ -534,9 +536,20 @@ For bigger values the width gets ignored.
|
|||
}
|
||||
else
|
||||
{
|
||||
// FIXME These should come from the typing attributes
|
||||
curParagraphStyle = [NSParagraphStyle defaultParagraphStyle];
|
||||
curFont = [NSFont userFontOfSize: 0];
|
||||
NSLayoutManager *layoutManager = [[curTextContainer textView] layoutManager];
|
||||
|
||||
if (layoutManager)
|
||||
{
|
||||
NSDictionary *typingAttributes = layoutManager->_typingAttributes;
|
||||
curParagraphStyle = [typingAttributes
|
||||
objectForKey: NSParagraphStyleAttributeName];
|
||||
curFont = [typingAttributes objectForKey: NSFontAttributeName];
|
||||
}
|
||||
else
|
||||
{
|
||||
curParagraphStyle = [NSParagraphStyle defaultParagraphStyle];
|
||||
curFont = [NSFont userFontOfSize: 0];
|
||||
}
|
||||
}
|
||||
|
||||
line_height = [curFont defaultLineHeightForFont];
|
||||
|
|
Loading…
Reference in a new issue