mirror of https://github.com/axmolengine/axmol.git
fix font for EditBox in iOS & Mac
This commit is contained in:
parent
3dbc453ee2
commit
89f4a1208b
|
@ -207,6 +207,8 @@ UIFont* EditBoxImplIOS::constructFont(const char *fontName, int fontSize)
|
|||
float retinaFactor = eaglview.contentScaleFactor;
|
||||
NSString * fntName = [NSString stringWithUTF8String:fontName];
|
||||
|
||||
fntName = [[fntName lastPathComponent] stringByDeletingPathExtension];
|
||||
|
||||
auto glview = cocos2d::Director::getInstance()->getOpenGLView();
|
||||
float scaleFactor = glview->getScaleX();
|
||||
|
||||
|
|
|
@ -377,6 +377,7 @@ bool EditBoxImplMac::initWithSize(const Size& size)
|
|||
NSFont* EditBoxImplMac::constructFont(const char *fontName, int fontSize)
|
||||
{
|
||||
NSString * fntName = [NSString stringWithUTF8String:fontName];
|
||||
fntName = [[fntName lastPathComponent] stringByDeletingPathExtension];
|
||||
float retinaFactor = _inRetinaMode ? 2.0f : 1.0f;
|
||||
auto glview = cocos2d::Director::getInstance()->getOpenGLView();
|
||||
float scaleFactor = glview->getScaleX();
|
||||
|
|
Loading…
Reference in New Issue