mirror of https://github.com/axmolengine/axmol.git
Fix boundingRectWithSize compile failed with OSX 10.10 or lower version SDK
This commit is contained in:
parent
69a6406661
commit
770f3d7f8e
|
@ -73,7 +73,15 @@ static NSSize _calculateStringSize(NSString *str, id font, CGSize *constrainSize
|
||||||
|
|
||||||
NSSize dim;
|
NSSize dim;
|
||||||
NSDictionary *attibutes = @{NSFontAttributeName:font};
|
NSDictionary *attibutes = @{NSFontAttributeName:font};
|
||||||
|
#ifdef __MAC_10_11
|
||||||
|
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_11
|
||||||
dim = [str boundingRectWithSize:textRect options:(NSStringDrawingOptions)(NSStringDrawingUsesLineFragmentOrigin) attributes:attibutes context:nil].size;
|
dim = [str boundingRectWithSize:textRect options:(NSStringDrawingOptions)(NSStringDrawingUsesLineFragmentOrigin) attributes:attibutes context:nil].size;
|
||||||
|
#else
|
||||||
|
dim = [str boundingRectWithSize:textRect options:(NSStringDrawingOptions)(NSStringDrawingUsesLineFragmentOrigin) attributes:attibutes].size;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
dim = [str boundingRectWithSize:textRect options:(NSStringDrawingOptions)(NSStringDrawingUsesLineFragmentOrigin) attributes:attibutes].size;
|
||||||
|
#endif
|
||||||
|
|
||||||
dim.width = ceilf(dim.width);
|
dim.width = ceilf(dim.width);
|
||||||
dim.height = ceilf(dim.height);
|
dim.height = ceilf(dim.height);
|
||||||
|
|
Loading…
Reference in New Issue