Fix to default Shadow Color setting
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.cpp
index 7d05f52..4f86678 100644 (file)
@@ -58,6 +58,8 @@ struct ModifyEvent
   std::string text;
 };
 
+const std::string EMPTY_STRING("");
+
 } // namespace
 
 namespace Dali
@@ -648,8 +650,8 @@ struct Controller::TextInput
       FontId defaultFontId = 0u;
       if( NULL == mFontDefaults )
       {
-        defaultFontId = mFontClient.GetFontId( String::EMPTY,
-                                               String::EMPTY );
+        defaultFontId = mFontClient.GetFontId( EMPTY_STRING,
+                                               EMPTY_STRING );
       }
       else
       {
@@ -985,8 +987,9 @@ struct Controller::Impl
     // Set the text properties to default
     mVisualModel->SetTextColor( Color::WHITE );
     mVisualModel->SetShadowOffset( Vector2::ZERO );
-    mVisualModel->SetShadowColor( Vector4::ZERO );
+    mVisualModel->SetShadowColor( Color::BLACK );
     mVisualModel->SetUnderlineEnabled( false );
+    mVisualModel->SetUnderlineHeight( 0.0f );
   }
 
   ~Impl()
@@ -1096,7 +1099,7 @@ const std::string& Controller::GetDefaultFontFamily() const
     return mImpl->mFontDefaults->mDefaultFontFamily;
   }
 
-  return String::EMPTY;;
+  return EMPTY_STRING;
 }
 
 void Controller::SetDefaultFontStyle( const std::string& defaultFontStyle )
@@ -1132,7 +1135,7 @@ const std::string& Controller::GetDefaultFontStyle() const
     return mImpl->mFontDefaults->mDefaultFontStyle;
   }
 
-  return String::EMPTY;
+  return EMPTY_STRING;
 }
 
 void Controller::SetDefaultPointSize( float pointSize )
@@ -1210,6 +1213,11 @@ bool Controller::IsUnderlineEnabled() const
   return mImpl->mVisualModel->IsUnderlineEnabled();
 }
 
+float Controller::GetUnderlineHeight() const
+{
+  return mImpl->mVisualModel->GetUnderlineHeight();
+}
+
 void Controller::SetTextColor( const Vector4& textColor )
 {
   mImpl->mVisualModel->SetTextColor( textColor );
@@ -1235,6 +1243,11 @@ void Controller::SetUnderlineEnabled( bool enabled )
   mImpl->mVisualModel->SetUnderlineEnabled( enabled );
 }
 
+void Controller::SetUnderlineHeight( float height )
+{
+  mImpl->mVisualModel->SetUnderlineHeight( height );
+}
+
 void Controller::EnableTextInput( DecoratorPtr decorator )
 {
   if( !mImpl->mTextInput )
@@ -1802,6 +1815,7 @@ bool Controller::DoRelayout( const Size& size,
 
     Vector<LineBreakInfo>& lineBreakInfo = mImpl->mLogicalModel->mLineBreakInfo;
     Vector<WordBreakInfo>& wordBreakInfo = mImpl->mLogicalModel->mWordBreakInfo;
+    Vector<CharacterDirection>& characterDirection = mImpl->mLogicalModel->mCharacterDirections;
     Vector<GlyphInfo>& glyphs = mImpl->mVisualModel->mGlyphs;
     Vector<CharacterIndex>& glyphsToCharactersMap = mImpl->mVisualModel->mGlyphsToCharacters;
     Vector<Length>& charactersPerGlyph = mImpl->mVisualModel->mCharactersPerGlyph;
@@ -1811,6 +1825,7 @@ bool Controller::DoRelayout( const Size& size,
                                        mImpl->mLogicalModel->mText.Begin(),
                                        lineBreakInfo.Begin(),
                                        wordBreakInfo.Begin(),
+                                       ( 0u != characterDirection.Count() ) ? characterDirection.Begin() : NULL,
                                        numberOfGlyphs,
                                        glyphs.Begin(),
                                        glyphsToCharactersMap.Begin(),