From 834a72315a5c111a219bf3a651fd83206e3c8688 Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 19 May 2014 17:43:27 +0800 Subject: [PATCH] issue #5183, add deprecated function for Widget --- cocos/ui/UIWidget.cpp | 5 +++++ cocos/ui/UIWidget.h | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index a74c8d24b8..71de114da7 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -876,6 +876,11 @@ LayoutParameter* Widget::getLayoutParameter() { return dynamic_cast(_layoutParameterDictionary.at((int)_layoutParameterType)); } + +LayoutParameter* Widget::getLayoutParameter(LayoutParameter::Type type) +{ + return dynamic_cast(_layoutParameterDictionary.at((int)type)); +} std::string Widget::getDescription() const { diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 044ce5833c..718336168f 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -485,6 +485,8 @@ public: * @return LayoutParameter */ LayoutParameter* getLayoutParameter() override; + CC_DEPRECATED_ATTRIBUTE LayoutParameter* getLayoutParameter(LayoutParameter::Type type); + /** * Ignore the widget size @@ -672,9 +674,12 @@ protected: Size _size; Size _customSize; bool _ignoreSize; - bool _affectByClipping; + SizeType _sizeType; Vec2 _sizePercent; + + bool _affectByClipping; + PositionType _positionType; Vec2 _positionPercent; bool _reorderWidgetChildDirty;