Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

label的问题 #40

Closed
zcgit opened this issue Feb 11, 2014 · 1 comment
Closed

label的问题 #40

zcgit opened this issue Feb 11, 2014 · 1 comment

Comments

@zcgit
Copy link
Contributor

zcgit commented Feb 11, 2014

static CGFloat getAscent(void* refCon) {
Span& span = (Span)refCon;
NSString* name = [NSString stringWithCString:span.imageName
encoding:NSUTF8StringEncoding];
UIImage* image = [s_imageMap objectForKey:name];
return (span.height != 0 ? span.height : (image.size.height * span.scaleY)) * CC_CONTENT_SCALE_FACTOR();
}

static CGFloat getDescent(void* refCon) {
return 0;
}

static CGFloat getWidth(void* refCon) {
Span& span = (Span)refCon;
NSString* name = [NSString stringWithCString:span.imageName
encoding:NSUTF8StringEncoding];
UIImage* image = [s_imageMap objectForKey:name];
return (span.width != 0 ? span.width : (image.size.width * span.scaleX)) * CC_CONTENT_SCALE_FACTOR();
}

要加上* CC_CONTENT_SCALE_FACTOR()吗?

@stubma
Copy link
Owner

stubma commented Feb 11, 2014

不用, 系统api自己会处理retina

@stubma stubma closed this as completed Feb 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants