Skip to content

Commit

Permalink
fix Mac system font crash issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zilongshanren committed Jul 29, 2015
1 parent dc931db commit 6de387b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cocos/platform/mac/CCDevice-mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ static bool _initWithString(const char * text, Device::TextAlign align, const ch
CGSize dimensions = CGSizeMake(info->width, info->height);


if(dimensions.width <= 0 && dimensions.height <= 0) {
dimensions.width = realDimensions.width;
dimensions.height = realDimensions.height;
} else if (dimensions.height <= 0) {
dimensions.height = realDimensions.height;
}
if(dimensions.width <= 0) {
dimensions.width = realDimensions.width;
}

if (dimensions.height <= 0) {
dimensions.height = realDimensions.height;
}

NSInteger POTWide = dimensions.width;
NSInteger POTHigh = MAX(dimensions.height, realDimensions.height);
Expand Down

0 comments on commit 6de387b

Please sign in to comment.