From 5da1f1f78c8c1ea3253e599d41be1f40f255cfc8 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 27 May 2014 10:54:47 +0800 Subject: [PATCH] add constness to UIText --- cocos/ui/UIText.cpp | 12 ++++++------ cocos/ui/UIText.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cocos/ui/UIText.cpp b/cocos/ui/UIText.cpp index 88b0aafa36..5d4efd57df 100644 --- a/cocos/ui/UIText.cpp +++ b/cocos/ui/UIText.cpp @@ -136,7 +136,7 @@ void Text::setFontSize(int size) _labelRendererAdaptDirty = true; } -int Text::getFontSize() +int Text::getFontSize()const { return _fontSize; } @@ -160,7 +160,7 @@ void Text::setFontName(const std::string& name) _labelRendererAdaptDirty = true; } -const std::string& Text::getFontName() +const std::string& Text::getFontName()const { return _fontName; } @@ -177,7 +177,7 @@ void Text::setTextAreaSize(const Size &size) _labelRendererAdaptDirty = true; } -const Size& Text::getTextAreaSize() +const Size& Text::getTextAreaSize()const { return _labelRenderer->getDimensions(); } @@ -189,7 +189,7 @@ void Text::setTextHorizontalAlignment(TextHAlignment alignment) _labelRendererAdaptDirty = true; } -TextHAlignment Text::getTextHorizontalAlignment() +TextHAlignment Text::getTextHorizontalAlignment()const { return _labelRenderer->getHorizontalAlignment(); } @@ -201,7 +201,7 @@ void Text::setTextVerticalAlignment(TextVAlignment alignment) _labelRendererAdaptDirty = true; } -TextVAlignment Text::getTextVerticalAlignment() +TextVAlignment Text::getTextVerticalAlignment()const { return _labelRenderer->getVerticalAlignment(); } @@ -211,7 +211,7 @@ void Text::setTouchScaleChangeEnabled(bool enable) _touchScaleChangeEnabled = enable; } -bool Text::isTouchScaleChangeEnabled() +bool Text::isTouchScaleChangeEnabled()const { return _touchScaleChangeEnabled; } diff --git a/cocos/ui/UIText.h b/cocos/ui/UIText.h index d0bc342a08..b3cc3bd6b0 100644 --- a/cocos/ui/UIText.h +++ b/cocos/ui/UIText.h @@ -104,7 +104,7 @@ public: */ void setFontSize(int size); - int getFontSize(); + int getFontSize()const; /** * Sets the font name of label. @@ -117,7 +117,7 @@ public: */ void setFontName(const std::string& name); - const std::string& getFontName(); + const std::string& getFontName()const; Type getType() const; @@ -133,7 +133,7 @@ public: * * @return touch scale enabled of label. */ - bool isTouchScaleChangeEnabled(); + bool isTouchScaleChangeEnabled()const; //override "getVirtualRendererSize" method of widget. virtual const Size& getVirtualRendererSize() const override; @@ -148,15 +148,15 @@ public: void setTextAreaSize(const Size &size); - const Size& getTextAreaSize(); + const Size& getTextAreaSize()const; void setTextHorizontalAlignment(TextHAlignment alignment); - TextHAlignment getTextHorizontalAlignment(); + TextHAlignment getTextHorizontalAlignment()const; void setTextVerticalAlignment(TextVAlignment alignment); - TextVAlignment getTextVerticalAlignment(); + TextVAlignment getTextVerticalAlignment()const; CC_CONSTRUCTOR_ACCESS: virtual bool init() override;