Merge "Updates following rename of PropertyBuffer to VertexBuffer" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / atlas / text-atlas-renderer.cpp
index dddb301..4fc28f8 100755 (executable)
@@ -369,10 +369,10 @@ struct AtlasRenderer::Impl
     {
       // Create a container actor to act as a common parent for text and shadow, to avoid color inheritence issues.
       mActor = Actor::New();
-      mActor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-      mActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-      mActor.SetSize( textSize );
-      mActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
+      mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+      mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+      mActor.SetProperty( Actor::Property::SIZE, textSize );
+      mActor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR );
     }
 
     for( std::vector< MeshRecord >::const_iterator it = meshContainer.begin(),
@@ -403,7 +403,7 @@ struct AtlasRenderer::Impl
 
         Actor shadowActor = CreateMeshActor(textControl, animatablePropertyIndex, color, meshRecord, textSize, STYLE_DROP_SHADOW );
 #if defined(DEBUG_ENABLED)
-        shadowActor.SetName( "Text Shadow renderable actor" );
+        shadowActor.SetProperty( Dali::Actor::Property::NAME, "Text Shadow renderable actor" );
 #endif
         // Offset shadow in x and y
         shadowActor.RegisterProperty("uOffset", shadowOffset );
@@ -549,7 +549,8 @@ struct AtlasRenderer::Impl
         }
 
         // Move the origin (0,0) of the mesh to the center of the actor
-        const Vector2 position = *( positionsBuffer + i ) - halfTextSize - lineOffsetPosition;
+        const Vector2& temp = *( positionsBuffer + i );
+        const Vector2 position = Vector2( roundf( temp.x ), temp.y ) - halfTextSize - lineOffsetPosition; // roundf() avoids pixel alignment issues.
 
         if ( 0u != slot.mImageId ) // invalid slot id, glyph has failed to be added to atlas
         {
@@ -678,7 +679,7 @@ struct AtlasRenderer::Impl
   Actor CreateMeshActor( Actor textControl, Property::Index animatablePropertyIndex, const Vector4& defaultColor, const MeshRecord& meshRecord,
                          const Vector2& actorSize, Style style )
   {
-    PropertyBuffer quadVertices = PropertyBuffer::New( mQuadVertexFormat );
+    VertexBuffer quadVertices = VertexBuffer::New( mQuadVertexFormat );
     quadVertices.SetData( const_cast< AtlasManager::Vertex2D* >( &meshRecord.mMesh.mVertices[ 0 ] ), meshRecord.mMesh.mVertices.Size() );
 
     Geometry quadGeometry = Geometry::New();
@@ -736,15 +737,15 @@ struct AtlasRenderer::Impl
 
     Actor actor = Actor::New();
 #if defined(DEBUG_ENABLED)
-    actor.SetName( "Text renderable actor" );
+    actor.SetProperty( Dali::Actor::Property::NAME, "Text renderable actor" );
 #endif
     actor.AddRenderer( renderer );
     // Keep all of the origins aligned
-    actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-    actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    actor.SetSize( actorSize );
+    actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+    actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+    actor.SetProperty( Actor::Property::SIZE, actorSize );
     actor.RegisterProperty("uOffset", Vector2::ZERO );
-    actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
+    actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR );
 
     return actor;
   }