From 89cc53735045be1efec395c9319e6a54862a5ea2 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Thu, 15 Nov 2012 03:24:32 +0100 Subject: [PATCH] Fix missed out Prefix changed in TTTAttributedLabel / BITAttributedLabel --- Classes/BITAttributedLabel.h | 10 +++++----- Classes/BITAttributedLabel.m | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Classes/BITAttributedLabel.h b/Classes/BITAttributedLabel.h index 9b898d587f..3481bd9e20 100755 --- a/Classes/BITAttributedLabel.h +++ b/Classes/BITAttributedLabel.h @@ -35,27 +35,27 @@ typedef enum { /** Determines whether the text to which this attribute applies has a strikeout drawn through itself. */ -extern NSString * const kTTTStrikeOutAttributeName; +extern NSString * const kBITStrikeOutAttributeName; /** The background fill color. Value must be a `CGColorRef`. Default value is `nil` (no fill). */ -extern NSString * const kTTTBackgroundFillColorAttributeName; +extern NSString * const kBITBackgroundFillColorAttributeName; /** The background stroke color. Value must be a `CGColorRef`. Default value is `nil` (no stroke). */ -extern NSString * const kTTTBackgroundStrokeColorAttributeName; +extern NSString * const kBITBackgroundStrokeColorAttributeName; /** The background stroke line width. Value must be an `NSNumber`. Default value is `1.0f`. */ -extern NSString * const kTTTBackgroundLineWidthAttributeName; +extern NSString * const kBITBackgroundLineWidthAttributeName; /** The background corner radius. Value must be an `NSNumber`. Default value is `5.0f`. */ -extern NSString * const kTTTBackgroundCornerRadiusAttributeName; +extern NSString * const kBITBackgroundCornerRadiusAttributeName; @protocol BITAttributedLabelDelegate; diff --git a/Classes/BITAttributedLabel.m b/Classes/BITAttributedLabel.m index 6baef4162c..31e5f417bc 100755 --- a/Classes/BITAttributedLabel.m +++ b/Classes/BITAttributedLabel.m @@ -22,16 +22,16 @@ #import "BITAttributedLabel.h" -#define kTTTLineBreakWordWrapTextWidthScalingFactor (M_PI / M_E) +#define kBITLineBreakWordWrapTextWidthScalingFactor (M_PI / M_E) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" -NSString * const kTTTStrikeOutAttributeName = @"TTTStrikeOutAttribute"; -NSString * const kTTTBackgroundFillColorAttributeName = @"TTTBackgroundFillColor"; -NSString * const kTTTBackgroundStrokeColorAttributeName = @"TTTBackgroundStrokeColor"; -NSString * const kTTTBackgroundLineWidthAttributeName = @"TTTBackgroundLineWidth"; -NSString * const kTTTBackgroundCornerRadiusAttributeName = @"TTTBackgroundCornerRadius"; +NSString * const kBITStrikeOutAttributeName = @"BITStrikeOutAttribute"; +NSString * const kBITBackgroundFillColorAttributeName = @"BITBackgroundFillColor"; +NSString * const kBITBackgroundStrokeColorAttributeName = @"BITBackgroundStrokeColor"; +NSString * const kBITBackgroundLineWidthAttributeName = @"BITBackgroundLineWidth"; +NSString * const kBITBackgroundCornerRadiusAttributeName = @"BITBackgroundCornerRadius"; static inline CTTextAlignment CTTextAlignmentFromUITextAlignment(UITextAlignment alignment) { switch (alignment) { @@ -564,10 +564,10 @@ static inline NSAttributedString * NSAttributedStringBySettingColorFromContext(N for (id glyphRun in (__bridge NSArray *)CTLineGetGlyphRuns((__bridge CTLineRef)line)) { NSDictionary *attributes = (__bridge NSDictionary *)CTRunGetAttributes((__bridge CTRunRef) glyphRun); - CGColorRef strokeColor = (__bridge CGColorRef)[attributes objectForKey:kTTTBackgroundStrokeColorAttributeName]; - CGColorRef fillColor = (__bridge CGColorRef)[attributes objectForKey:kTTTBackgroundFillColorAttributeName]; - CGFloat cornerRadius = [[attributes objectForKey:kTTTBackgroundCornerRadiusAttributeName] floatValue]; - CGFloat lineWidth = [[attributes objectForKey:kTTTBackgroundLineWidthAttributeName] floatValue]; + CGColorRef strokeColor = (__bridge CGColorRef)[attributes objectForKey:kBITBackgroundStrokeColorAttributeName]; + CGColorRef fillColor = (__bridge CGColorRef)[attributes objectForKey:kBITBackgroundFillColorAttributeName]; + CGFloat cornerRadius = [[attributes objectForKey:kBITBackgroundCornerRadiusAttributeName] floatValue]; + CGFloat lineWidth = [[attributes objectForKey:kBITBackgroundLineWidthAttributeName] floatValue]; if (strokeColor || fillColor) { CGRect runBounds = CGRectZero; @@ -623,7 +623,7 @@ static inline NSAttributedString * NSAttributedStringBySettingColorFromContext(N for (id glyphRun in (__bridge NSArray *)CTLineGetGlyphRuns((__bridge CTLineRef)line)) { NSDictionary *attributes = (__bridge NSDictionary *)CTRunGetAttributes((__bridge CTRunRef) glyphRun); - BOOL strikeOut = [[attributes objectForKey:kTTTStrikeOutAttributeName] boolValue]; + BOOL strikeOut = [[attributes objectForKey:kBITStrikeOutAttributeName] boolValue]; NSInteger superscriptStyle = [[attributes objectForKey:(id)kCTSuperscriptAttributeName] integerValue]; if (strikeOut) { @@ -788,7 +788,7 @@ static inline NSAttributedString * NSAttributedStringBySettingColorFromContext(N CGFloat textWidth = [self sizeThatFits:CGSizeZero].width; CGFloat availableWidth = self.frame.size.width * self.numberOfLines; if (self.numberOfLines > 1 && self.lineBreakMode == UILineBreakModeWordWrap) { - textWidth *= kTTTLineBreakWordWrapTextWidthScalingFactor; + textWidth *= kBITLineBreakWordWrapTextWidthScalingFactor; } if (textWidth > availableWidth && textWidth > 0.0f) {