diff --git a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp index 96bf4bae20..1ec46e2fc6 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp @@ -519,7 +519,7 @@ namespace cocostudio auto layoutComponentTable = ((WidgetOptions*)nodeOptions)->layoutComponent(); if (!layoutComponentTable) return; - auto layoutComponent = ui::LayoutComponent::boundingLayoutComponent(node); + auto layoutComponent = ui::LayoutComponent::bindLayoutComponent(node); bool positionXPercentEnabled = layoutComponentTable->positionXPercentEnabled(); bool positionYPercentEnabled = layoutComponentTable->positionYPercentEnabled(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp index 7ee01269eb..7e462d7033 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp @@ -868,7 +868,7 @@ namespace cocostudio auto layoutComponentTable = ((WidgetOptions*)nodeOptions)->layoutComponent(); if (!layoutComponentTable) return; - auto layoutComponent = ui::LayoutComponent::boundingLayoutComponent(node); + auto layoutComponent = ui::LayoutComponent::bindLayoutComponent(node); bool positionXPercentEnabled = layoutComponentTable->positionXPercentEnabled(); bool positionYPercentEnabled = layoutComponentTable->positionYPercentEnabled(); diff --git a/cocos/ui/UILayoutComponent.cpp b/cocos/ui/UILayoutComponent.cpp index 907cafc029..2498630aeb 100644 --- a/cocos/ui/UILayoutComponent.cpp +++ b/cocos/ui/UILayoutComponent.cpp @@ -57,7 +57,7 @@ namespace ui { } - LayoutComponent* LayoutComponent::boundingLayoutComponent(Node* node) + LayoutComponent* LayoutComponent::bindLayoutComponent(Node* node) { LayoutComponent * layout = (LayoutComponent*)node->getComponent(__LAYOUT_COMPONENT_NAME); if (layout != nullptr) diff --git a/cocos/ui/UILayoutComponent.h b/cocos/ui/UILayoutComponent.h index a824e7e190..6021d37fb3 100644 --- a/cocos/ui/UILayoutComponent.h +++ b/cocos/ui/UILayoutComponent.h @@ -38,7 +38,7 @@ namespace ui { virtual bool init()override; CREATE_FUNC(LayoutComponent); - static LayoutComponent* boundingLayoutComponent(Node* node); + static LayoutComponent* bindLayoutComponent(Node* node); enum class HorizontalEdge { diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp index bbb8e31605..67ab74a09c 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp @@ -755,25 +755,25 @@ bool UILayoutComponent_Berth_Test::init() if (UILayoutComponentTest::init()) { Sprite* leftTopSprite = Sprite::create("cocosui/CloseSelected.png"); - LayoutComponent* leftTop = LayoutComponent::boundingLayoutComponent(leftTopSprite); + LayoutComponent* leftTop = LayoutComponent::bindLayoutComponent(leftTopSprite); leftTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left); leftTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top); _baseLayer->addChild(leftTopSprite); Sprite* leftBottomSprite = Sprite::create("cocosui/CloseSelected.png"); - LayoutComponent* leftBottom = LayoutComponent::boundingLayoutComponent(leftBottomSprite); + LayoutComponent* leftBottom = LayoutComponent::bindLayoutComponent(leftBottomSprite); leftBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left); leftBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom); _baseLayer->addChild(leftBottomSprite); Sprite* rightTopSprite = Sprite::create("cocosui/CloseSelected.png"); - LayoutComponent* rightTop = LayoutComponent::boundingLayoutComponent(rightTopSprite); + LayoutComponent* rightTop = LayoutComponent::bindLayoutComponent(rightTopSprite); rightTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right); rightTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top); _baseLayer->addChild(rightTopSprite); Sprite* rightBottomSprite = Sprite::create("cocosui/CloseSelected.png"); - LayoutComponent* rightBottom = LayoutComponent::boundingLayoutComponent(rightBottomSprite); + LayoutComponent* rightBottom = LayoutComponent::bindLayoutComponent(rightBottomSprite); rightBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right); rightBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom); _baseLayer->addChild(rightBottomSprite); @@ -791,7 +791,7 @@ bool UILayoutComponent_Berth_Stretch_Test::init() { ImageView* leftTopSprite = ImageView::create("cocosui/CloseSelected.png"); leftTopSprite->ignoreContentAdaptWithSize(false); - LayoutComponent* leftTop = LayoutComponent::boundingLayoutComponent(leftTopSprite); + LayoutComponent* leftTop = LayoutComponent::bindLayoutComponent(leftTopSprite); leftTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left); leftTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top); leftTop->setStretchWidthEnabled(true); @@ -803,7 +803,7 @@ bool UILayoutComponent_Berth_Stretch_Test::init() ImageView* leftBottomSprite = ImageView::create("cocosui/CloseSelected.png"); leftBottomSprite->ignoreContentAdaptWithSize(false); - LayoutComponent* leftBottom = LayoutComponent::boundingLayoutComponent(leftBottomSprite); + LayoutComponent* leftBottom = LayoutComponent::bindLayoutComponent(leftBottomSprite); leftBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left); leftBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom); leftBottom->setStretchWidthEnabled(true); @@ -815,7 +815,7 @@ bool UILayoutComponent_Berth_Stretch_Test::init() ImageView* rightTopSprite = ImageView::create("cocosui/CloseSelected.png"); rightTopSprite->ignoreContentAdaptWithSize(false); - LayoutComponent* rightTop = LayoutComponent::boundingLayoutComponent(rightTopSprite); + LayoutComponent* rightTop = LayoutComponent::bindLayoutComponent(rightTopSprite); rightTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right); rightTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top); rightTop->setStretchWidthEnabled(true); @@ -827,7 +827,7 @@ bool UILayoutComponent_Berth_Stretch_Test::init() ImageView* rightBottomSprite = ImageView::create("cocosui/CloseSelected.png"); rightBottomSprite->ignoreContentAdaptWithSize(false); - LayoutComponent* rightBottom = LayoutComponent::boundingLayoutComponent(rightBottomSprite); + LayoutComponent* rightBottom = LayoutComponent::bindLayoutComponent(rightBottomSprite); rightBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right); rightBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom); rightBottom->setStretchWidthEnabled(true); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp index cc2e483b32..4e8be76776 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp @@ -1235,7 +1235,7 @@ void UILayoutComponentTest_Editor::configureGUIScene() Text* back_label = Text::create("Back", "", 20); back_label->setTouchEnabled(true); - auto labelLayout = LayoutComponent::boundingLayoutComponent(back_label); + auto labelLayout = LayoutComponent::bindLayoutComponent(back_label); labelLayout->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right); labelLayout->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom); back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this));