mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Add maximumLineCount to ASTextNode... which corresponds to maximumNumberOfLines on the underlying container
This commit is contained in:
@@ -243,6 +243,7 @@ ASDISPLAYNODE_INLINE CGFloat ceilPixelValue(CGFloat f)
|
||||
_renderer = [[ASTextNodeRenderer alloc] initWithAttributedString:_attributedString
|
||||
truncationString:_composedTruncationString
|
||||
truncationMode:_truncationMode
|
||||
maximumLineCount:_maximumLineCount
|
||||
constrainedSize:constrainedSize];
|
||||
}
|
||||
return _renderer;
|
||||
@@ -905,6 +906,15 @@ ASDISPLAYNODE_INLINE CGFloat ceilPixelValue(CGFloat f)
|
||||
return [[self _renderer] truncationStringCharacterRange].location != NSNotFound;
|
||||
}
|
||||
|
||||
- (void)setMaximumLineCount:(NSUInteger)maximumLineCount
|
||||
{
|
||||
if (_maximumLineCount != maximumLineCount) {
|
||||
_maximumLineCount = maximumLineCount;
|
||||
[self _invalidateRenderer];
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSUInteger)lineCount
|
||||
{
|
||||
return [[self _renderer] lineCount];
|
||||
|
||||
Reference in New Issue
Block a user