/*
- * Copyright (c) 2016 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.
return Text::RendererPtr( new VectorBasedRenderer() );
}
-Actor VectorBasedRenderer::Render( Text::ViewInterface& view, int /*depth*/ )
+Actor VectorBasedRenderer::Render( Text::ViewInterface& view,
+ Actor textControl,
+ Property::Index animatablePropertyIndex,
+ float& alignmentOffset,
+ int /*depth*/ )
{
UnparentAndReset( mImpl->mActor );
mImpl->mActor = Actor::New();
- mImpl->mActor.SetParentOrigin( ParentOrigin::CENTER );
- mImpl->mActor.SetSize( view.GetControlSize() );
- mImpl->mActor.SetColor( Color::WHITE );
+ mImpl->mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mImpl->mActor.SetProperty( Actor::Property::SIZE, Vector2( view.GetControlSize() ) );
+ mImpl->mActor.SetProperty( Actor::Property::COLOR, Color::WHITE );
#if defined(DEBUG_ENABLED)
- mImpl->mActor.SetName( "Text renderable actor" );
+ mImpl->mActor.SetProperty( Dali::Actor::Property::NAME, "Text renderable actor" );
#endif
Length numberOfGlyphs = view.GetNumberOfGlyphs();
numberOfGlyphs = view.GetGlyphs( glyphs.Begin(),
positions.Begin(),
+ alignmentOffset,
0u,
numberOfGlyphs );
+
glyphs.Resize( numberOfGlyphs );
positions.Resize( numberOfGlyphs );
Vector< unsigned short > indices;
const Vector2& controlSize = view.GetControlSize();
- float xOffset = controlSize.width * -0.5f;
+ float xOffset = -alignmentOffset + controlSize.width * -0.5f;
float yOffset = controlSize.height * -0.5f;
if( ! mImpl->mAtlas ||
if( 0 != vertices.Count() )
{
- PropertyBuffer quadVertices = PropertyBuffer::New( mImpl->mQuadVertexFormat );
+ VertexBuffer quadVertices = VertexBuffer::New( mImpl->mQuadVertexFormat );
quadVertices.SetData( &vertices[ 0 ], vertices.Size() );
{
delete mImpl;
}
-