//
//  MultilineLabel.m
//  HotPocket (iOS)
//
//  Created by Tomek Wójcik on 25/09/2025.
//

#import "MultilineLabel.h"

@implementation MultilineLabel

-(void)drawTextInRect:(CGRect)rect {
    if (!self.text) {
        [super drawTextInRect:rect];
        return;
    }
    
    CGSize textSize = [self sizeThatFits:CGSizeMake(rect.size.width, CGFLOAT_MAX)];
    CGRect textRect = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, MIN(rect.size.height, textSize.height));
    
    [super drawTextInRect:textRect];
}

@end
