Minor fix.

--HG--
branch : dev
This commit is contained in:
Martí­n Lucas Golini
2017-03-24 03:33:58 -03:00
parent e88dd406b3
commit 97558261ae
2 changed files with 21 additions and 18 deletions

View File

@@ -139,6 +139,10 @@ class EE_API UITextView : public UIWidget {
virtual void onAlignChange();
void recalculate();
void resetSelCache();
};
}}

View File

@@ -81,9 +81,7 @@ Graphics::Font * UITextView::getFont() const {
UITextView * UITextView::setFont( Graphics::Font * font ) {
if ( mTextCache->getFont() != font ) {
mTextCache->setFont( font );
autoShrink();
onAutoSize();
alignFix();
recalculate();
onFontChanged();
}
@@ -97,9 +95,7 @@ Uint32 UITextView::getCharacterSize() {
UITextView *UITextView::setCharacterSize( const Uint32 & characterSize ) {
if ( mTextCache->getCharacterSize() != characterSize ) {
mTextCache->setCharacterSize( characterSize );
autoShrink();
onAutoSize();
alignFix();
recalculate();
}
return this;
@@ -117,9 +113,7 @@ UITextView * UITextView::setOutlineThickness( const Float & outlineThickness ) {
if ( mFontStyleConfig.OutlineThickness != outlineThickness ) {
mTextCache->setOutlineThickness( outlineThickness );
mFontStyleConfig.OutlineThickness = outlineThickness;
autoShrink();
onAutoSize();
alignFix();
recalculate();
}
return this;
@@ -142,9 +136,7 @@ UITextView * UITextView::setFontStyle(const Uint32 & fontStyle) {
if ( mFontStyleConfig.Style != fontStyle ) {
mTextCache->setStyle( fontStyle );
mFontStyleConfig.Style = fontStyle;
autoShrink();
onAutoSize();
alignFix();
recalculate();
}
return this;
@@ -165,9 +157,7 @@ UITextView * UITextView::setText( const String& text ) {
mTextCache->setString( text );
}
autoShrink();
onAutoSize();
alignFix();
recalculate();
onTextChanged();
return this;
@@ -274,9 +264,7 @@ Uint32 UITextView::onFocusLoss() {
}
void UITextView::onSizeChange() {
autoShrink();
onAutoSize();
alignFix();
recalculate();
UIControlAnim::onSizeChange();
}
@@ -452,6 +440,17 @@ void UITextView::onAlignChange() {
alignFix();
}
void UITextView::recalculate() {
autoShrink();
onAutoSize();
alignFix();
resetSelCache();
}
void UITextView::resetSelCache() {
mLastSelCurInit = mLastSelCurEnd = -1;
}
void UITextView::setFontStyleConfig( const UITooltipStyleConfig& fontStyleConfig ) {
mFontStyleConfig = fontStyleConfig;