Merge "If the size of the text is larger than the size of the control, setting it...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / text / text-visual.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 9ddbf3b..61dcdfc
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -383,7 +383,7 @@ void TextVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
 
 
 TextVisual::TextVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ),
+: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO, Toolkit::Visual::TEXT ),
   mController( Text::Controller::New() ),
   mTypesetter( Text::Typesetter::New( mController->GetTextModel() ) ),
   mAnimatableTextColorPropertyIndex( Property::INVALID_INDEX ),
@@ -421,7 +421,7 @@ void TextVisual::DoSetProperties( const Property::Map& propertyMap )
   engine.SetCursorWidth( 0u ); // Do not layout space for the cursor.
 }
 
-void TextVisual::DoSetOnStage( Actor& actor )
+void TextVisual::DoSetOnScene( Actor& actor )
 {
   mControl = actor;
 
@@ -476,7 +476,7 @@ void TextVisual::RemoveRenderer( Actor& actor )
   mRendererList.clear();
 }
 
-void TextVisual::DoSetOffStage( Actor& actor )
+void TextVisual::DoSetOffScene( Actor& actor )
 {
   RemoveRenderer( actor );
 
@@ -820,8 +820,11 @@ void TextVisual::AddRenderer( Actor& actor, const Vector2& size, bool hasMultipl
     // Get the current offset for recalculate the offset when tiling.
     Property::Map retMap;
     mImpl->mTransform.GetPropertyMap( retMap );
-    Vector2 offSet = retMap.Find( Dali::Toolkit::Visual::Transform::Property::OFFSET )->Get< Vector2 >();
-    info.offSet = offSet;
+    Property::Value* offsetValue = retMap.Find( Dali::Toolkit::Visual::Transform::Property::OFFSET );
+    if( offsetValue )
+    {
+      offsetValue->Get( info.offSet );
+    }
 
     // Create a textureset in the default renderer.
     CreateTextureSet( info, mImpl->mRenderer, sampler, hasMultipleTextColors, containsColorGlyph, styleEnabled );