Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cocos/platform/mac/CCDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ static bool _initWithString(const char * text, Device::TextAlign align, const ch
NSMutableString *lineBreak = [[[NSMutableString alloc] init] autorelease];
NSUInteger length = [string length];
NSRange range = NSMakeRange(0, 1);
CGSize textSize;
NSUInteger lastBreakLocation = 0;
NSUInteger insertCount = 0;
for (NSUInteger i = 0; i < length; i++) {
Expand All @@ -128,7 +127,7 @@ static bool _initWithString(const char * text, Device::TextAlign align, const ch
if ([@"!?.,-= " rangeOfString:character].location != NSNotFound) {
lastBreakLocation = i + insertCount;
}
textSize = [lineBreak sizeWithAttributes:tokenAttributesDict];
auto textSize = [lineBreak sizeWithAttributes:tokenAttributesDict];
if(textSize.height > info->height)
break;
if (textSize.width > info->width) {
Expand Down