From b289d6010e4e576e2f451ec02e09fd21cef44778 Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Tue, 1 Nov 2016 22:29:42 +0800 Subject: [PATCH] fix editbox sierra --- native/cocos/2d/CCFontAtlas.cpp | 2 +- native/cocos/platform/desktop/CCGLViewImpl-desktop.cpp | 6 +++++- native/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm | 3 ++- native/external/config.json | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/native/cocos/2d/CCFontAtlas.cpp b/native/cocos/2d/CCFontAtlas.cpp index 605311ed08..bcc30370bb 100644 --- a/native/cocos/2d/CCFontAtlas.cpp +++ b/native/cocos/2d/CCFontAtlas.cpp @@ -209,7 +209,7 @@ void FontAtlas::conversionU16TOGB2312(const std::u16string& u16Text, std::unorde #else if (_iconv == nullptr) { - _iconv = iconv_open("gb2312", "utf-16le"); + _iconv = iconv_open("GBK//TRANSLIT", "UTF-16LE"); } if (_iconv == (iconv_t)-1) diff --git a/native/cocos/platform/desktop/CCGLViewImpl-desktop.cpp b/native/cocos/platform/desktop/CCGLViewImpl-desktop.cpp index c2c6ceaed2..8eb94bd4aa 100644 --- a/native/cocos/platform/desktop/CCGLViewImpl-desktop.cpp +++ b/native/cocos/platform/desktop/CCGLViewImpl-desktop.cpp @@ -822,6 +822,10 @@ void GLViewImpl::onGLFWframebuffersize(GLFWwindow* window, int w, int h) _retinaFactor = 1; glfwSetWindowSize(window, static_cast(frameSizeW * _retinaFactor * _frameZoomFactor), static_cast(frameSizeH * _retinaFactor * _frameZoomFactor)); } + + //FIXME: https://github.com/cocos2d/cocos2d-x/issues/16779 + Director::getInstance()->setViewport(); + Director::getInstance()->mainLoop(); } void GLViewImpl::onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int height) @@ -830,7 +834,7 @@ void GLViewImpl::onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int { Size baseDesignSize = _designResolutionSize; ResolutionPolicy baseResolutionPolicy = _resolutionPolicy; - + int frameWidth = width / _frameZoomFactor; int frameHeight = height / _frameZoomFactor; setFrameSize(frameWidth, frameHeight); diff --git a/native/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm b/native/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm index 5c26052ba3..fcd8c3b5d3 100644 --- a/native/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm +++ b/native/cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.mm @@ -63,6 +63,7 @@ - (void)createMultiLineTextField { CCUIMultilineTextField *textView = [[[CCUIMultilineTextField alloc] initWithFrame:self.frameRect] autorelease]; + [textView setVerticallyResizable:NO]; self.textInput = textView; } @@ -96,7 +97,7 @@ if (![_textInput isKindOfClass:[NSTextView class]]) { [_textInput performSelector:@selector(setBordered:) - withObject:[NSNumber numberWithBool:NO]]; + withObject:nil]; } _textInput.hidden = NO; _textInput.wantsLayer = YES; diff --git a/native/external/config.json b/native/external/config.json index 9e989a4df2..2f470d8d9b 100644 --- a/native/external/config.json +++ b/native/external/config.json @@ -1,5 +1,5 @@ { - "version":"v3-deps-15", + "version":"v3-deps-16", "zip_file_size":"60696601", "repo_name":"cocos2d-x-lite-external", "repo_parent":"https://github.com/cocos-creator/"