X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-input%2Ftext-input-text-highlight-impl.cpp;h=2659f489f6a08a86b772902aabd079b5e1d46b4e;hb=refs%2Fchanges%2F58%2F36458%2F1;hp=7475678f0e34e12769839c9840727ad083ec2eae;hpb=c25e929c2b63e961197e0bd5396184454e068b17;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp b/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp index 7475678..2659f48 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp +++ b/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp @@ -252,110 +252,10 @@ TextHighlight::HighlightInfo TextHighlight::CalculateHighlightInfo( std::size_t void TextHighlight::UpdateHighlight( TextHighlight::HighlightInfo& newHighlightInfo ) { -// Construct a Mesh with a texture to be used as the highlight 'box' for selected text -// -// Example scenarios where mesh is made from 3, 1, 2, 2 ,3 or 3 quads. -// -// [ TOP ] [ TOP ] [TOP ] [ TOP ] [ TOP ] [ TOP ] -// [ MIDDLE ] [BOTTOM] [BOTTOM] [ MIDDLE ] [ MIDDLE ] -// [ BOTTOM] [ MIDDLE ] [ MIDDLE ] -// [BOTTOM] [ MIDDLE ] -// [BOTTOM] -// -// Each quad is created as 2 triangles. -// Middle is just 1 quad regardless of its size. -// -// (0,0) (0,0) -// 0* *2 0* *2 -// TOP TOP -// 3* *1 3* *1 -// 4* *1 4* *6 -// MIDDLE BOTTOM -// 6* *5 7* *5 -// 6* *8 -// BOTTOM -// 9* *7 -// - - // vertex and triangle buffers should always be present if MeshActor is alive. - //HighlightInfo newHighlightInfo = CalculateHighlightInfo( handlePositionStart, handlePositionEnd ); - MeshData::VertexContainer vertices; - Dali::MeshData::FaceIndices faceIndices; - - if( !newHighlightInfo.mQuadList.empty() ) - { - std::vector::iterator iter = newHighlightInfo.mQuadList.begin(); - std::vector::iterator endIter = newHighlightInfo.mQuadList.end(); - - // vertex position defaults to (0 0 0) - MeshData::Vertex vertex; - // set normal for all vertices as (0 0 1) pointing outward from TextInput Actor. - vertex.nZ = 1.0f; - - for(std::size_t v = 0; iter != endIter; ++iter,v+=4 ) - { - // Add each quad geometry (a sub-selection) to the mesh data. - - // 0-----1 - // |\ | - // | \ A | - // | \ | - // | B \ | - // | \| - // 2-----3 - - QuadCoordinates& quad = *iter; - // top-left (v+0) - vertex.x = quad.min.x; - vertex.y = quad.min.y; - vertices.push_back( vertex ); - - // top-right (v+1) - vertex.x = quad.max.x; - vertex.y = quad.min.y; - vertices.push_back( vertex ); - - // bottom-left (v+2) - vertex.x = quad.min.x; - vertex.y = quad.max.y; - vertices.push_back( vertex ); - - // bottom-right (v+3) - vertex.x = quad.max.x; - vertex.y = quad.max.y; - vertices.push_back( vertex ); - - // triangle A (3, 1, 0) - faceIndices.push_back( v + 3 ); - faceIndices.push_back( v + 1 ); - faceIndices.push_back( v ); - - // triangle B (0, 2, 3) - faceIndices.push_back( v ); - faceIndices.push_back( v + 2 ); - faceIndices.push_back( v + 3 ); - } - - mMeshData.SetVertices( vertices ); - mMeshData.SetFaceIndices( faceIndices ); - - mHighlightMesh.UpdateMeshData(mMeshData); - } } -Mesh TextHighlight::CreateHighLightMesh() +void TextHighlight::CreateHighLightMesh() { - mMeshData = MeshData( ); - mMeshData.SetHasNormals( true ); - - mCustomMaterial = Material::New("CustomMaterial"); - mCustomMaterial.SetDiffuseColor( LIGHTBLUE ); - - mMeshData.SetMaterial( mCustomMaterial ); - - mHighlightMesh = Mesh::New( mMeshData ); - - return mHighlightMesh; } void TextHighlight::HighlightInfo::AddQuad( float x1, float y1, float x2, float y2 )