add constness to UIText

This commit is contained in:
andyque 2014-05-27 10:54:47 +08:00
parent 5acd2ed89d
commit 5da1f1f78c
2 changed files with 12 additions and 12 deletions

View File

@ -136,7 +136,7 @@ void Text::setFontSize(int size)
_labelRendererAdaptDirty = true; _labelRendererAdaptDirty = true;
} }
int Text::getFontSize() int Text::getFontSize()const
{ {
return _fontSize; return _fontSize;
} }
@ -160,7 +160,7 @@ void Text::setFontName(const std::string& name)
_labelRendererAdaptDirty = true; _labelRendererAdaptDirty = true;
} }
const std::string& Text::getFontName() const std::string& Text::getFontName()const
{ {
return _fontName; return _fontName;
} }
@ -177,7 +177,7 @@ void Text::setTextAreaSize(const Size &size)
_labelRendererAdaptDirty = true; _labelRendererAdaptDirty = true;
} }
const Size& Text::getTextAreaSize() const Size& Text::getTextAreaSize()const
{ {
return _labelRenderer->getDimensions(); return _labelRenderer->getDimensions();
} }
@ -189,7 +189,7 @@ void Text::setTextHorizontalAlignment(TextHAlignment alignment)
_labelRendererAdaptDirty = true; _labelRendererAdaptDirty = true;
} }
TextHAlignment Text::getTextHorizontalAlignment() TextHAlignment Text::getTextHorizontalAlignment()const
{ {
return _labelRenderer->getHorizontalAlignment(); return _labelRenderer->getHorizontalAlignment();
} }
@ -201,7 +201,7 @@ void Text::setTextVerticalAlignment(TextVAlignment alignment)
_labelRendererAdaptDirty = true; _labelRendererAdaptDirty = true;
} }
TextVAlignment Text::getTextVerticalAlignment() TextVAlignment Text::getTextVerticalAlignment()const
{ {
return _labelRenderer->getVerticalAlignment(); return _labelRenderer->getVerticalAlignment();
} }
@ -211,7 +211,7 @@ void Text::setTouchScaleChangeEnabled(bool enable)
_touchScaleChangeEnabled = enable; _touchScaleChangeEnabled = enable;
} }
bool Text::isTouchScaleChangeEnabled() bool Text::isTouchScaleChangeEnabled()const
{ {
return _touchScaleChangeEnabled; return _touchScaleChangeEnabled;
} }

View File

@ -104,7 +104,7 @@ public:
*/ */
void setFontSize(int size); void setFontSize(int size);
int getFontSize(); int getFontSize()const;
/** /**
* Sets the font name of label. * Sets the font name of label.
@ -117,7 +117,7 @@ public:
*/ */
void setFontName(const std::string& name); void setFontName(const std::string& name);
const std::string& getFontName(); const std::string& getFontName()const;
Type getType() const; Type getType() const;
@ -133,7 +133,7 @@ public:
* *
* @return touch scale enabled of label. * @return touch scale enabled of label.
*/ */
bool isTouchScaleChangeEnabled(); bool isTouchScaleChangeEnabled()const;
//override "getVirtualRendererSize" method of widget. //override "getVirtualRendererSize" method of widget.
virtual const Size& getVirtualRendererSize() const override; virtual const Size& getVirtualRendererSize() const override;
@ -148,15 +148,15 @@ public:
void setTextAreaSize(const Size &size); void setTextAreaSize(const Size &size);
const Size& getTextAreaSize(); const Size& getTextAreaSize()const;
void setTextHorizontalAlignment(TextHAlignment alignment); void setTextHorizontalAlignment(TextHAlignment alignment);
TextHAlignment getTextHorizontalAlignment(); TextHAlignment getTextHorizontalAlignment()const;
void setTextVerticalAlignment(TextVAlignment alignment); void setTextVerticalAlignment(TextVAlignment alignment);
TextVAlignment getTextVerticalAlignment(); TextVAlignment getTextVerticalAlignment()const;
CC_CONSTRUCTOR_ACCESS: CC_CONSTRUCTOR_ACCESS:
virtual bool init() override; virtual bool init() override;