diff --git a/cocos/2d/CCCameraBackgroundBrush.cpp b/cocos/2d/CCCameraBackgroundBrush.cpp index 8f52b2ea74..38917ec992 100644 --- a/cocos/2d/CCCameraBackgroundBrush.cpp +++ b/cocos/2d/CCCameraBackgroundBrush.cpp @@ -232,8 +232,8 @@ CameraBackgroundSkyBoxBrush::CameraBackgroundSkyBoxBrush() , _vertexBuffer(0) , _indexBuffer(0) , _texture(nullptr) -, _actived(false) -, _textureValid(false) +, _actived(true) +, _textureValid(true) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index b64b677212..abc7648240 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -235,7 +235,7 @@ void Button::loadTextureNormal(const std::string& normal,TextureResType texType) bool textureLoaded = true; if (normal.empty()) { - _buttonNormalRenderer->init(); + _buttonNormalRenderer->resetRender(); textureLoaded = false; } else @@ -289,7 +289,7 @@ void Button::loadTexturePressed(const std::string& selected,TextureResType texTy bool textureLoade = true; if (selected.empty()) { - _buttonClickedRenderer->init(); + _buttonClickedRenderer->resetRender(); textureLoade = false; } else @@ -332,7 +332,7 @@ void Button::loadTextureDisabled(const std::string& disabled,TextureResType texT bool textureLoaded = true; if (disabled.empty()) { - _buttonDisabledRenderer->init(); + _buttonDisabledRenderer->resetRender(); textureLoaded = false; } else diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index fad149260c..ec3f82c579 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -157,7 +157,7 @@ void Slider::loadBarTexture(const std::string& fileName, TextureResType texType) _barTexType = texType; if (fileName.empty()) { - _barRenderer->init(); + _barRenderer->resetRender(); } else { @@ -196,7 +196,7 @@ void Slider::loadProgressBarTexture(const std::string& fileName, TextureResType _progressBarTexType = texType; if (fileName.empty()) { - _progressBarRenderer->init(); + _progressBarRenderer->resetRender(); } else { diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index 2a3674f00b..990cc6aa85 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -2084,6 +2084,7 @@ void LabelLayoutBaseTest::initWrapOption(const cocos2d::Size& size) checkBox->setScale(0.5); checkBox->setSelected(true); checkBox->setName("toggleWrap"); + checkBox->setEnabled(false); checkBox->addEventListener([=](Ref* ref, CheckBox::EventType event){ if (event == CheckBox::EventType::SELECTED) {