mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Skip calculating a zero size for empty RSSingleLineView and RSSingleLineRenderer.
This commit is contained in:
@@ -120,7 +120,11 @@ static NSMutableDictionary *rendererCache = nil;
|
||||
|
||||
|
||||
- (NSSize)size {
|
||||
|
||||
|
||||
if (self.title.string.length < 1) {
|
||||
return NSZeroSize;
|
||||
}
|
||||
|
||||
if (NSEqualSizes(_size, NSZeroSize)) {
|
||||
_size = [self calculatedSize];
|
||||
}
|
||||
@@ -173,7 +177,7 @@ static const CGFloat kMaxHeight = 10000.0;
|
||||
|
||||
CGContextSetFillColorWithColor(context, self.backgroundColor.CGColor);
|
||||
CGContextFillRect(context, r);
|
||||
|
||||
|
||||
CGContextSetShouldSmoothFonts(context, true);
|
||||
|
||||
CTFrameDraw(self.frameref, context);
|
||||
|
||||
@@ -109,7 +109,12 @@ static NSAttributedString *emptyAttributedString = nil;
|
||||
- (NSSize)intrinsicContentSize {
|
||||
|
||||
if (!self.intrinsicSizeIsValid) {
|
||||
self.intrinsicSize = ((RSSingleLineRenderer *)(self.renderer)).size;
|
||||
if (!self.attributedStringValue) {
|
||||
self.intrinsicSize = NSZeroSize;
|
||||
}
|
||||
else {
|
||||
self.intrinsicSize = ((RSSingleLineRenderer *)(self.renderer)).size;
|
||||
}
|
||||
self.intrinsicSizeIsValid = YES;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user