Merge pull request #15568 from zilongshanren/fix-jsb-related-issues

fix jsb 3.11 related issues
This commit is contained in:
minggo 2016-05-05 11:01:44 +08:00
commit 44063b8e85
6 changed files with 42 additions and 1 deletions

View File

@ -240,6 +240,18 @@ void VideoPlayer::setVisible(bool visible)
}
}
void VideoPlayer::onEnter()
{
Widget::onEnter();
this->setVisible(true);
}
void VideoPlayer::onExit()
{
Widget::onExit();
this->setVisible(false);
}
void VideoPlayer::addEventListener(const VideoPlayer::ccVideoPlayerCallback& callback)
{
_eventCallback = callback;

View File

@ -343,6 +343,18 @@ bool VideoPlayer::isFullScreenEnabled()const
return [((UIVideoViewWrapperIos*)_videoView) isFullScreenEnabled];
}
void VideoPlayer::onEnter()
{
Widget::onEnter();
[((UIVideoViewWrapperIos*)_videoView) setVisible:YES];
}
void VideoPlayer::onExit()
{
Widget::onExit();
[((UIVideoViewWrapperIos*)_videoView) setVisible:NO];
}
void VideoPlayer::setFullScreenEnabled(bool enabled)
{
[((UIVideoViewWrapperIos*)_videoView) setFullScreenEnabled:enabled];

View File

@ -172,6 +172,8 @@ namespace experimental{
virtual void onPlayEvent(int event);
virtual void setVisible(bool visible) override;
virtual void draw(Renderer *renderer, const Mat4& transform, uint32_t flags) override;
virtual void onEnter() override;
virtual void onExit() override;
protected:
virtual cocos2d::ui::Widget* createCloneInstance() override;

View File

@ -198,6 +198,18 @@ namespace experimental{
return _onJSCallback;
}
void WebView::onEnter()
{
Widget::onEnter();
_impl->setVisible(true);
}
void WebView::onExit()
{
Widget::onExit();
_impl->setVisible(false);
}
} // namespace ui
} // namespace experimental
} //namespace cocos2d

View File

@ -204,6 +204,9 @@ public:
*/
virtual void setVisible(bool visible) override;
virtual void onEnter() override;
virtual void onExit() override;
protected:
virtual cocos2d::ui::Widget* createCloneInstance() override;
virtual void copySpecialProperties(Widget* model) override;

View File

@ -1965,7 +1965,7 @@ var WrapAlgorithmTest = AtlasDemo.extend({
LabelTTF.setString(text);
LabelTTF.setPosition(480 + i * 25, 300);
LabelTTF.setAnchorPoint(0,1);
LabelTTF.boundingWidth = 3;
LabelTTF.boundingWidth = 13;
LabelTTF.boundingHeight = 0;
LabelTTF.enableStroke(cc.color(0, 0, 0, 1), 3.0);
if (cc.sys.os === cc.sys.OS_WP8)