Skip to content

Commit

Permalink
Fix Xcode warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ibireme committed Aug 6, 2017
1 parent 7725c32 commit 7bd2aa4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions YYText/Component/YYTextLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -2251,7 +2251,7 @@ static void YYTextDrawRun(YYTextLine *line, CTRunRef run, CGContextRef context,

CGContextSaveGState(context); {
CGContextSetFillColorWithColor(context, fillColor);
if (!strokeWidth || strokeWidth.floatValue == 0) {
if (strokeWidth == nil || strokeWidth.floatValue == 0) {
CGContextSetTextDrawingMode(context, kCGTextFill);
} else {
CGColorRef strokeColor = (CGColorRef)CFDictionaryGetValue(runAttrs, kCTStrokeColorAttributeName);
Expand Down Expand Up @@ -2901,7 +2901,7 @@ static void YYTextDrawDecoration(YYTextLayout *layout, CGContextRef context, CGS
color = (__bridge CGColorRef)(attrs[(id)kCTForegroundColorAttributeName]);
color = YYTextGetCGColor(color);
}
CGFloat thickness = underline.width ? underline.width.floatValue : lineThickness;
CGFloat thickness = (underline.width != nil) ? underline.width.floatValue : lineThickness;
YYTextShadow *shadow = underline.shadow;
while (shadow) {
if (!shadow.color) {
Expand Down Expand Up @@ -2930,7 +2930,7 @@ static void YYTextDrawDecoration(YYTextLayout *layout, CGContextRef context, CGS
color = (__bridge CGColorRef)(attrs[(id)kCTForegroundColorAttributeName]);
color = YYTextGetCGColor(color);
}
CGFloat thickness = strikethrough.width ? strikethrough.width.floatValue : lineThickness;
CGFloat thickness = (strikethrough.width != nil) ? strikethrough.width.floatValue : lineThickness;
YYTextShadow *shadow = underline.shadow;
while (shadow) {
if (!shadow.color) {
Expand Down
2 changes: 1 addition & 1 deletion YYText/String/YYTextAttribute.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ YYTextAttributeType YYTextAttributeGetType(NSString *name){
dic[YYTextGlyphTransformAttributeName] = YYText;
});
NSNumber *num = dic[name];
if (num) return num.integerValue;
if (num != nil) return num.integerValue;
return YYTextAttributeTypeNone;
}

Expand Down

0 comments on commit 7bd2aa4

Please sign in to comment.