+ for( std::size_t v = 0; iter != endIter; ++iter,v+=4 )
+ {
+
+ QuadCoordinates& quad = *iter;
+
+ // top-left (v+0)
+ vertex.x = quad.min.x;
+ vertex.y = quad.min.y;
+ vertices.PushBack( vertex );
+
+ // top-right (v+1)
+ vertex.x = quad.max.x;
+ vertex.y = quad.min.y;
+ vertices.PushBack( vertex );
+
+ // bottom-left (v+2)
+ vertex.x = quad.min.x;
+ vertex.y = quad.max.y;
+ vertices.PushBack( vertex );
+
+ // bottom-right (v+3)
+ vertex.x = quad.max.x;
+ vertex.y = quad.max.y;
+ vertices.PushBack( vertex );
+
+ // triangle A (3, 1, 0)
+ indices.PushBack( v + 3 );
+ indices.PushBack( v + 1 );
+ indices.PushBack( v );
+
+ // triangle B (0, 2, 3)
+ indices.PushBack( v );
+ indices.PushBack( v + 2 );
+ indices.PushBack( v + 3 );
+ }
+
+ if( mQuadVertices )
+ {
+ mQuadVertices.SetSize( vertices.Size() );
+ }
+ else
+ {
+ mQuadVertices = PropertyBuffer::New( mQuadVertexFormat, vertices.Size() );
+ }
+
+ if( mQuadIndices )
+ {
+ mQuadIndices.SetSize( indices.Size() );
+ }
+ else
+ {
+ mQuadIndices = PropertyBuffer::New( mQuadIndexFormat, indices.Size() );
+ }
+
+ mQuadVertices.SetData( &vertices[ 0 ] );
+ mQuadIndices.SetData( &indices[ 0 ] );
+
+ mQuadGeometry = Geometry::New();
+ mQuadGeometry.AddVertexBuffer( mQuadVertices );
+ mQuadGeometry.SetIndexBuffer( mQuadIndices );
+
+ if( mHighlightRenderer )
+ {
+ mHighlightRenderer.SetGeometry( mQuadGeometry );
+ }
+ else
+ {
+ mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightMaterial );
+ mHighlightActor.AddRenderer( mHighlightRenderer );
+ }