Merge "Make internal actors size match TextLabel size" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / decorator / text-decorator.cpp
index 49fe080..d09eacb 100644 (file)
@@ -805,24 +805,25 @@ struct Decorator::Impl : public ConnectionTracker
         mQuadVertices.SetData( &vertices[ 0 ] );
         mQuadIndices.SetData( &indices[ 0 ] );
 
-        mQuadGeometry = Geometry::New();
-        mQuadGeometry.AddVertexBuffer( mQuadVertices );
-        mQuadGeometry.SetIndexBuffer( mQuadIndices );
-
-        if( mHighlightRenderer )
+        if( !mQuadGeometry )
         {
-          mHighlightRenderer.SetGeometry( mQuadGeometry );
+          mQuadGeometry = Geometry::New();
+          mQuadGeometry.AddVertexBuffer( mQuadVertices );
         }
-        else
+        mQuadGeometry.SetIndexBuffer( mQuadIndices );
+
+        if( !mHighlightRenderer )
         {
           mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightMaterial );
           mHighlightActor.AddRenderer( mHighlightRenderer );
         }
-
-        mHighlightActor.SetPosition( mHighlightPosition.x,
-                                     mHighlightPosition.y );
       }
 
+      mHighlightActor.SetPosition( mHighlightPosition.x,
+                                   mHighlightPosition.y );
+
+      mHighlightQuadList.clear();
+
       mHighlightRenderer.SetDepthIndex( mTextDepth - 2u ); // text is rendered at mTextDepth and text's shadow at mTextDepth -1u.
     }
   }
@@ -1527,6 +1528,7 @@ void Decorator::SetEnabledPopupButtons( TextSelectionPopup::Buttons& enabledButt
    if( mImpl->mActiveLayer )
    {
      mImpl->mActiveLayer.Add( mImpl->mCopyPastePopup.actor );
+     mImpl->mCopyPastePopup.actor.ShowPopup();
    }
 }