|
@@ -243,12 +243,11 @@
|
|
|
NSString *sampleStr = @"Sample";
|
|
|
CGContextSetAlpha(context, self.opcity);
|
|
|
UIFont *font = [UIFont fontWithName:self.fontName size:self.thickness];
|
|
|
- NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
if (!self.fillColor) {
|
|
|
self.fillColor = [UIColor whiteColor];
|
|
|
}
|
|
|
NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:sampleStr attributes:@{NSFontAttributeName:font, NSForegroundColorAttributeName:self.fillColor}];
|
|
|
- CGSize textSize = [attributedText boundingRectWithSize:rect.size options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) context:nil].size;
|
|
|
+ CGSize textSize = [attributedText boundingRectWithSize:self.bounds.size options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) context:nil].size;
|
|
|
|
|
|
CGFloat x = self.bounds.origin.x + (self.bounds.size.width - textSize.width) / 2.0;
|
|
|
CGFloat y = self.bounds.origin.y + (self.bounds.size.height - textSize.height) / 2.0;
|