mNotifyEndOfScroll( false )
{
mQuadVertexFormat[ "aPosition" ] = Property::VECTOR2;
- mQuadIndexFormat[ "indices" ] = Property::INTEGER;
- mHighlightMaterial = Material::New( Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ) );
-
+ mHighlightShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
SetupTouchEvents();
}
{
const HandleImpl& primaryHandle = mHandle[LEFT_SELECTION_HANDLE];
const HandleImpl& secondaryHandle = mHandle[RIGHT_SELECTION_HANDLE];
- const HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
if( primaryHandle.active || secondaryHandle.active )
else
{
// Calculates the popup's position if the grab handle is active.
- mCopyPastePopup.position = Vector3( cursor.position.x, -0.5f * popupSize.height - grabHandle.size.height + cursor.position.y, 0.0f );
+ const HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
+ if( grabHandle.verticallyFlipped )
+ {
+ mCopyPastePopup.position = Vector3( cursor.position.x, -0.5f * popupSize.height - grabHandle.size.height + cursor.position.y, 0.0f );
+ }
+ else
+ {
+ mCopyPastePopup.position = Vector3( cursor.position.x, -0.5f * popupSize.height + cursor.position.y, 0.0f );
+ }
}
}
if( !mHighlightQuadList.empty() )
{
Vector< Vector2 > vertices;
- Vector< unsigned int> indices;
+ Vector< unsigned short> indices;
Vector2 vertex;
std::vector<QuadCoordinates>::iterator iter = mHighlightQuadList.begin();
mQuadVertices = PropertyBuffer::New( mQuadVertexFormat );
}
- if( ! mQuadIndices )
- {
- mQuadIndices = PropertyBuffer::New( mQuadIndexFormat );
- }
-
mQuadVertices.SetData( &vertices[ 0 ], vertices.Size() );
- mQuadIndices.SetData( &indices[ 0 ], indices.Size() );
if( !mQuadGeometry )
{
mQuadGeometry = Geometry::New();
mQuadGeometry.AddVertexBuffer( mQuadVertices );
}
- mQuadGeometry.SetIndexBuffer( mQuadIndices );
+ mQuadGeometry.SetIndexBuffer( &indices[ 0 ], indices.Size() );
if( !mHighlightRenderer )
{
- mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightMaterial );
+ mHighlightRenderer = Dali::Renderer::New( mQuadGeometry, mHighlightShader );
mHighlightActor.AddRenderer( mHighlightRenderer );
}
}
{
if( Gesture::Started == gesture.state )
{
- handle.grabDisplacementX = handle.grabDisplacementY = 0;
+ handle.grabDisplacementX = handle.grabDisplacementY = 0.f;
}
handle.grabDisplacementX += gesture.displacement.x;
- handle.grabDisplacementY += gesture.displacement.y;
+ handle.grabDisplacementY += ( handle.verticallyFlipped ? -gesture.displacement.y : gesture.displacement.y );
const float x = handle.position.x + handle.grabDisplacementX;
const float y = handle.position.y + handle.lineHeight*0.5f + handle.grabDisplacementY;
Actor mHighlightActor; ///< Actor to display highlight
Renderer mHighlightRenderer;
- Material mHighlightMaterial; ///< Material used for highlight
+ Shader mHighlightShader; ///< Shader used for highlight
Property::Map mQuadVertexFormat;
- Property::Map mQuadIndexFormat;
PopupImpl mCopyPastePopup;
TextSelectionPopup::Buttons mEnabledPopupButtons; /// Bit mask of currently enabled Popup buttons
TextSelectionPopupCallbackInterface& mTextSelectionPopupCallbackInterface;
HandleImpl mHandle[HANDLE_TYPE_COUNT];
PropertyBuffer mQuadVertices;
- PropertyBuffer mQuadIndices;
Geometry mQuadGeometry;
QuadContainer mHighlightQuadList; ///< Sub-selections that combine to create the complete selection highlight