mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 16:10:48 +00:00
Merge pull request #37 from trunkmaster/master
Insertion point height fix for NSText* objects
This commit is contained in:
commit
063e5708e7
5 changed files with 39 additions and 4 deletions
21
ChangeLog
21
ChangeLog
|
@ -1,3 +1,24 @@
|
|||
2019-12-11 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Source/GSHorizontalTypesetter.m: removed extra imports left from
|
||||
last 2 commits.
|
||||
|
||||
2019-12-10 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSLayoutManager.h,
|
||||
* Source/GSLayoutManager.m: new method -typingAttributes returns default
|
||||
typing attributes of NSTextView.
|
||||
* Source/NSLayoutManager.m: override GSLayoutManager's -typingAttributes
|
||||
- primitive method - provides access to _typingAttributes ivar.
|
||||
* Source/GSHorizontalTypesetter.m: use new GSLayoutManager's
|
||||
-typingAttributes method to get paragraph style and font of new empty text
|
||||
container. Normally `curLayoutManager` is a NSLayoutManager object so,
|
||||
actually, we get NSLayoutManager's _typingAttributes.
|
||||
|
||||
* 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)
|
||||
|
|
|
@ -168,6 +168,7 @@ If characters have been edited, lengthChange has the text length delta.
|
|||
forStartingGlyphAtIndex: (NSUInteger)glyph
|
||||
characterIndex: (NSUInteger)index;
|
||||
|
||||
- (NSDictionary *) typingAttributes;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -534,9 +534,10 @@ For bigger values the width gets ignored.
|
|||
}
|
||||
else
|
||||
{
|
||||
// FIXME These should come from the typing attributes
|
||||
curParagraphStyle = [NSParagraphStyle defaultParagraphStyle];
|
||||
curFont = [NSFont userFontOfSize: 0];
|
||||
NSDictionary *typingAttributes = [curLayoutManager typingAttributes];
|
||||
curParagraphStyle = [typingAttributes
|
||||
objectForKey: NSParagraphStyleAttributeName];
|
||||
curFont = [typingAttributes objectForKey: NSFontAttributeName];
|
||||
}
|
||||
|
||||
line_height = [curFont defaultLineHeightForFont];
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#import "AppKit/NSAttributedString.h"
|
||||
#import "AppKit/NSTextStorage.h"
|
||||
#import "AppKit/NSTextContainer.h"
|
||||
#import "AppKit/NSTextView.h"
|
||||
|
||||
/* just for NSAttachmentCharacter */
|
||||
#import "AppKit/NSTextAttachment.h"
|
||||
|
@ -3280,7 +3281,13 @@ forStartingGlyphAtIndex: (NSUInteger)glyph
|
|||
else if (attributeTag == NSGlyphAttributeBidiLevel)
|
||||
g->bidilevel = anInt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSDictionary *) typingAttributes
|
||||
{
|
||||
return [NSTextView defaultTypingAttributes];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* NSCoding protocol
|
||||
|
|
|
@ -3017,6 +3017,11 @@ no_soft_invalidation:
|
|||
}
|
||||
}
|
||||
|
||||
- (NSDictionary *) typingAttributes
|
||||
{
|
||||
return _typingAttributes;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue