//
//  KKStatusLabel.m
//  Open
//
//  Created by 雷俊博 on 2021/7/31.
//  Copyright © 2021 黄江涛 . All rights reserved.
//

#import "KKStatusLabel.h"

@implementation KKStatusLabel
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.textAlignment = NSTextAlignmentCenter;
        self.font = [UIFont systemFontOfSize:26];
        self.transform = CGAffineTransformMakeScale(0.7, 0.7);
        self.textColor = [UIColor colorWithHex:0x333333];
    }
    return self;
}

- (void)setLabelSelected:(BOOL)labelSelected
{
    _labelSelected = labelSelected;
    
    if (labelSelected) {
        self.font = [UIFont boldSystemFontOfSize:26];
        self.textColor = K_MainColor;
        self.transform = CGAffineTransformMakeScale(1.0, 1.0);
    }else{
        self.font = [UIFont systemFontOfSize:26];
        self.textColor = [UIColor colorWithHex:0x333333];
        self.transform = CGAffineTransformMakeScale(0.7, 0.7);
    }
}

- (void)drawTextInRect:(CGRect)rect {
    UIEdgeInsets insets = {0, 5, 0, 5};
    [super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
