mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-30 02:34:55 +01:00
60 lines
1.3 KiB
Objective-C
60 lines
1.3 KiB
Objective-C
//
|
|
// RSMultiLineRendererMeasurements.m
|
|
// RSTextDrawing
|
|
//
|
|
// Created by Brent Simmons on 3/4/16.
|
|
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
|
//
|
|
|
|
#import "RSMultiLineRendererMeasurements.h"
|
|
|
|
@implementation RSMultiLineRendererMeasurements
|
|
|
|
#pragma mark - Class Methods
|
|
|
|
+ (instancetype)measurementsWithHeight:(NSInteger)height heightOfFirstLine:(NSInteger)heightOfFirstLine {
|
|
|
|
return [[self alloc] initWithHeight:height heightOfFirstLine:heightOfFirstLine];
|
|
}
|
|
|
|
|
|
#pragma mark - Init
|
|
|
|
- (instancetype)initWithHeight:(NSInteger)height heightOfFirstLine:(NSInteger)heightOfFirstLine {
|
|
|
|
self = [super init];
|
|
if (!self) {
|
|
return nil;
|
|
}
|
|
|
|
_height = height;
|
|
_heightOfFirstLine = heightOfFirstLine;
|
|
|
|
return self;
|
|
}
|
|
|
|
- (BOOL)isEqualToMultiLineRendererMeasurements:(RSMultiLineRendererMeasurements *)otherMeasurements {
|
|
|
|
return self.height == otherMeasurements.height && self.heightOfFirstLine == otherMeasurements.heightOfFirstLine;
|
|
}
|
|
|
|
- (BOOL)isEqual:(id)object {
|
|
|
|
if (self == object) {
|
|
return YES;
|
|
}
|
|
if (![object isKindOfClass:[self class]]) {
|
|
return NO;
|
|
}
|
|
|
|
return [self isEqualToMultiLineRendererMeasurements:(RSMultiLineRendererMeasurements *)object];
|
|
}
|
|
|
|
- (NSUInteger)hash {
|
|
|
|
return (NSUInteger)(self.height + (self.heightOfFirstLine * 100000));
|
|
}
|
|
|
|
|
|
@end
|