diff --git a/cocos/ui/UIEditBox/UIEditBox.h b/cocos/ui/UIEditBox/UIEditBox.h index bd615b682c..c4e2a91287 100644 --- a/cocos/ui/UIEditBox/UIEditBox.h +++ b/cocos/ui/UIEditBox/UIEditBox.h @@ -43,8 +43,8 @@ namespace ui { class EditBoxImpl; /** - *@brief Editbox delgate class. - * It's useful when you want to do some customization duing Editbox input event + *@brief Editbox delegate class. + * It's useful when you want to do some customization during Editbox input event * * @js NA * @lua NA diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-linux.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-linux.cpp index 210b277ed3..f4488dc9af 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-linux.cpp +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-linux.cpp @@ -32,7 +32,7 @@ #include "base/ccUTF8.h" #include -// desoty dialog when lost focus +// destroy dialog when lost focus static void dialogFocusOutCallback(GtkWidget* widget, gpointer user_data) { gtk_widget_destroy(widget); diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-mac.mm b/cocos/ui/UIEditBox/UIEditBoxImpl-mac.mm index b5afaadf98..9d14db5a79 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-mac.mm +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-mac.mm @@ -537,7 +537,7 @@ NSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Vec2& designCoord, Vec2 visiblePos = Vec2(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY()); Vec2 screenGLPos = visiblePos + eglView->getViewPortRect().origin; - //TODO: I don't know why here needs to substract `height`. + //TODO: I don't know why here needs to subtract `height`. NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height); if (bInRetinaMode) { diff --git a/cocos/ui/UIHelper.h b/cocos/ui/UIHelper.h index 1adbb4decc..021c7ad489 100644 --- a/cocos/ui/UIHelper.h +++ b/cocos/ui/UIHelper.h @@ -49,8 +49,8 @@ class CC_GUI_DLL Helper public: /** * Find a widget with a specific tag from root widget. - * This search will be recursive throught all child widgets. - * @param root The be seached root widget. + * This search will be recursive through all child widgets. + * @param root The be searched root widget. * @param tag The widget tag. * @return Widget instance pointer. */ @@ -58,7 +58,7 @@ public: /** * Find a widget with a specific name from root widget. - * This search will be recursive throught all child widgets. + * This search will be recursive through all child widgets. * * @param root The be searched root widget. * @param name The widget name. @@ -68,7 +68,7 @@ public: /** * Find a widget with a specific action tag from root widget - * This search will be recursive throught all child widgets. + * This search will be recursive through all child widgets. *@param root The be searched root widget. *@param tag The widget action's tag. *@return Widget instance pointer. diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index 81ae344ed5..ef05f3dd33 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -1045,7 +1045,7 @@ Size Layout::getLayoutAccumulatedSize()const } } - //substract extra size + //subtract extra size Type type = this->getLayoutType(); if (type == Type::HORIZONTAL) { @@ -1063,7 +1063,7 @@ Vec2 Layout::getWorldCenterPoint(Widget* widget)const Layout *layout = dynamic_cast(widget); //FIXEDME: we don't need to calculate the content size of layout anymore Size widgetSize = layout ? layout->getLayoutAccumulatedSize() : widget->getContentSize(); -// CCLOG("contnet size : width = %f, height = %f", widgetSize.width, widgetSize.height); +// CCLOG("content size : width = %f, height = %f", widgetSize.width, widgetSize.height); return widget->convertToWorldSpace(Vec2(widgetSize.width/2, widgetSize.height/2)); } @@ -1153,7 +1153,7 @@ int Layout::findFirstFocusEnabledWidgetIndex() } index++; } - CCASSERT(0, "invalide operation"); + CCASSERT(0, "invalid operation"); return 0; } @@ -1467,7 +1467,7 @@ Widget* Layout::getPreviousFocusedWidget(FocusDirection direction, Widget *curre } else { - //handling the disabled widget, there is no actual focus lose or get, so we don't need any envet + //handling the disabled widget, there is no actual focus lose or get, so we don't need any event return this->getPreviousFocusedWidget(direction, nextWidget); } } diff --git a/cocos/ui/UILayoutComponent.h b/cocos/ui/UILayoutComponent.h index 769cea32b9..7cac449715 100644 --- a/cocos/ui/UILayoutComponent.h +++ b/cocos/ui/UILayoutComponent.h @@ -116,7 +116,7 @@ namespace ui { /** * Query the percent content size value. - *@return Percet (x,y) in Vec2. + *@return Percent (x,y) in Vec2. */ Vec2 getPercentContentSize()const; diff --git a/cocos/ui/UILayoutManager.h b/cocos/ui/UILayoutManager.h index 8bf404bd72..28404ea712 100644 --- a/cocos/ui/UILayoutManager.h +++ b/cocos/ui/UILayoutManager.h @@ -43,7 +43,7 @@ class RelativeLayoutParameter; /** *@brief Base class for managing layout. - * All the concret layout manager should inherit from this class. + * All the concrete layout manager should inherit from this class. */ class CC_GUI_DLL LayoutManager : public Ref { diff --git a/cocos/ui/UIListView.h b/cocos/ui/UIListView.h index 66e48efcf1..4ff9552b89 100644 --- a/cocos/ui/UIListView.h +++ b/cocos/ui/UIListView.h @@ -337,7 +337,7 @@ public: void scrollToItem(ssize_t itemIndex, const Vec2& positionRatioInView, const Vec2& itemAnchorPoint, float timeInSec); /** - * @brief Query current selected widget's idnex. + * @brief Query current selected widget's index. * * @return A index of a selected item. diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index 926eb936c4..49d0906c6a 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -65,7 +65,7 @@ class CC_GUI_DLL PageView : public ListView public: /** - * Page turn event tpye. + * Page turn event type. */ enum class EventType { diff --git a/cocos/ui/UIRichText.h b/cocos/ui/UIRichText.h index 4b918aac7d..37d24a2774 100644 --- a/cocos/ui/UIRichText.h +++ b/cocos/ui/UIRichText.h @@ -117,7 +117,7 @@ public: * @param text Content string. * @param fontName Content font name. * @param fontSize Content font size. - * @return True if initialize scucess, false otherwise. + * @return True if initialize success, false otherwise. */ bool init(int tag, const Color3B& color, GLubyte opacity, const std::string& text, const std::string& fontName, float fontSize); diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 1d3a60d480..f8d1398aa1 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -613,7 +613,7 @@ namespace ui { } /** sets the opacity. - @warning If the texture has premultiplied alpha then, the R, G and B channels will be modifed. + @warning If the texture has premultiplied alpha then, the R, G and B channels will be modified. Values goes from 0 to 255, where 255 means fully opaque. */ @@ -857,7 +857,7 @@ namespace ui { this->cleanupSlicedSprites(); - //we must invalide the transform when toggling scale9enabled + //we must invalid the transform when toggling scale9enabled _transformUpdated = _transformDirty = _inverseDirty = true; if (_scale9Enabled) @@ -1094,7 +1094,7 @@ namespace ui { auto atlasWidth = tex->getPixelsWide(); auto atlasHeight = tex->getPixelsHigh(); - //caculate texture coordinate + //calculate texture coordinate float leftWidth = 0, centerWidth = 0, rightWidth = 0; float topHeight = 0, centerHeight = 0, bottomHeight = 0; diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index 1dc5d851e9..218e0fcd5b 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -72,7 +72,7 @@ namespace ui { /** * Builtin shader state. - * Currenly support Normal and Gray state. + * Currently support Normal and Gray state. */ enum class State { @@ -427,7 +427,7 @@ namespace ui { * @param rect A delimitation zone. * @param rotated Whether the sprite is rotated or not. * @param offset The offset when slice the sprite. - * @param originalSize The origial size of the sprite. + * @param originalSize The original size of the sprite. * @param capInsets The Values to use for the cap insets. * @return True if update success, false otherwise. * @js NA diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index e4e5f0cf02..3cc24b17ce 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -455,7 +455,7 @@ void ScrollView::startAutoScroll(const Vec2& deltaMove, float timeInSec, bool at _autoScrollBraking = false; _autoScrollBrakingStartPosition = Vec2::ZERO; - // If the destination is also out of boundary of same side, start brake from beggining. + // If the destination is also out of boundary of same side, start brake from beginning. Vec2 currentOutOfBoundary = getHowMuchOutOfBoundary(); if(currentOutOfBoundary != Vec2::ZERO) { diff --git a/cocos/ui/UISlider.h b/cocos/ui/UISlider.h index d35b514d87..70642161a0 100644 --- a/cocos/ui/UISlider.h +++ b/cocos/ui/UISlider.h @@ -247,7 +247,7 @@ public: //override "ignoreContentAdaptWithSize" method of widget. virtual void ignoreContentAdaptWithSize(bool ignore) override; - //override the widget's hitTest function to perfom its own + //override the widget's hitTest function to perform its own virtual bool hitTest(const Vec2 &pt, const Camera* camera, Vec3 *p) const override; /** * Returns the "class name" of widget. diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index 964dce5f2e..b06b8f0f41 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -969,14 +969,14 @@ protected: bool _flippedX; bool _flippedY; - //use map to enble switch back and forth for user layout parameters + //use map to enable switch back and forth for user layout parameters Map _layoutParameterDictionary; LayoutParameter::Type _layoutParameterType; bool _focused; bool _focusEnabled; /** - * store the only one focued widget + * store the only one focused widget */ static Widget *_focusedWidget; //both layout & widget will be stored in this variable