From 1c47c833c6887a83d67a8f1d6aceaf67e471944e Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 13 May 2014 14:56:44 +0800 Subject: [PATCH] issue #5005, fixed widget visit method --- cocos/ui/UIWidget.cpp | 2 +- cocos/ui/UIWidget.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index cba820fffc..f050b576d8 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -122,7 +122,7 @@ void Widget::onExit() void Widget::visit(Renderer *renderer, const Matrix &parentTransform, bool parentTransformUpdated) { - if (_enabled) + if (_visible) { adaptRenderers(); ProtectedNode::visit(renderer, parentTransform, parentTransformUpdated); diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 2a319a3d83..a2e873358f 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -122,11 +122,12 @@ public: /** * Sets whether the widget is enabled + * + * true if the widget is enabled, widget may be touched , false if the widget is disabled, widget cannot be touched. * - * Highest control of widget. * The default value is true, a widget is default to enabled * - * @param enabled true if the widget is enabled, widget may be touched and visible, false if the widget is disabled, widget cannot be touched and hidden. + * @param enabled */ virtual void setEnabled(bool enabled);