Copied some TextInput grab/selection handle code
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / text / rendering / basic / text-basic-renderer.cpp
index 702eddb..5cd608f 100644 (file)
 // CLASS HEADER
 #include <dali-toolkit/public-api/text/rendering/basic/text-basic-renderer.h>
 
-// EXTERNAL INCLUDES
-#include <dali/dali.h>
-
 // INTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/font-client.h>
+#include <dali/public-api/actors/mesh-actor.h>
+#include <dali/public-api/images/atlas.h>
+#include <dali/public-api/geometry/mesh.h>
 #include <dali-toolkit/public-api/text/rendering/shaders/text-basic-shader.h>
 
 using namespace Dali;
@@ -278,6 +279,8 @@ Text::RendererPtr BasicRenderer::New()
 
 RenderableActor BasicRenderer::Render( Text::ViewInterface& view )
 {
+  UnparentAndReset( mImpl->mActor );
+
   Text::Length numberOfGlyphs = view.GetNumberOfGlyphs();
 
   if( numberOfGlyphs > 0 )
@@ -285,11 +288,11 @@ RenderableActor BasicRenderer::Render( Text::ViewInterface& view )
     Vector<GlyphInfo> glyphs;
     glyphs.Resize( numberOfGlyphs );
 
-    view.GetGlyphs( 0, &glyphs[0], numberOfGlyphs );
+    view.GetGlyphs( &glyphs[0], 0, numberOfGlyphs );
 
     std::vector<Vector2> positions;
     positions.resize( numberOfGlyphs );
-    view.GetGlyphPositions( 0, &positions[0], numberOfGlyphs );
+    view.GetGlyphPositions( &positions[0], 0, numberOfGlyphs );
 
     Atlas atlas = mImpl->CreateAtlas( glyphs );