CursorImpl()
: x(0.0f),
y(0.0f),
- height(0.0f),
+ cursorHeight(0.0f),
+ lineHeight(0.0f),
color(Dali::Color::WHITE)
{
}
float x;
float y;
- float height;
+ float cursorHeight;
+ float lineHeight;
Vector4 color;
};
SelectionHandleImpl()
: x(0.0f),
y(0.0f),
- cursorHeight(0.0f),
+ lineHeight(0.0f),
flipped(false)
{
}
float x;
float y;
- float cursorHeight; ///< Not the handle height
+ float lineHeight; ///< Not the handle height
bool flipped;
ImageActor actor;
{
mPrimaryCursor.SetPosition( mCursor[PRIMARY_CURSOR].x + scrollPosition.x,
mCursor[PRIMARY_CURSOR].y + scrollPosition.y );
- mPrimaryCursor.SetSize( Vector2( 1.0f, mCursor[PRIMARY_CURSOR].height ) );
+ mPrimaryCursor.SetSize( Size( 1.0f, mCursor[PRIMARY_CURSOR].cursorHeight ) );
}
if( mSecondaryCursor )
{
mSecondaryCursor.SetPosition( mCursor[SECONDARY_CURSOR].x + scrollPosition.x,
mCursor[SECONDARY_CURSOR].y + scrollPosition.y );
- mSecondaryCursor.SetSize( Vector2( 1.0f, mCursor[SECONDARY_CURSOR].height ) );
+ mSecondaryCursor.SetSize( Size( 1.0f, mCursor[SECONDARY_CURSOR].cursorHeight ) );
}
// Show or hide the grab handle
CreateGrabHandle();
mGrabHandle.SetPosition( mCursor[PRIMARY_CURSOR].x + scrollPosition.x,
- mCursor[PRIMARY_CURSOR].y + scrollPosition.y + mCursor[PRIMARY_CURSOR].height );
+ mCursor[PRIMARY_CURSOR].y + scrollPosition.y + mCursor[PRIMARY_CURSOR].lineHeight );
}
else if( mGrabHandle )
{
SelectionHandleImpl& primary = mSelectionHandle[ PRIMARY_SELECTION_HANDLE ];
primary.actor.SetPosition( primary.x + scrollPosition.x,
- primary.y + scrollPosition.y + primary.cursorHeight );
+ primary.y + scrollPosition.y + primary.lineHeight );
SelectionHandleImpl& secondary = mSelectionHandle[ SECONDARY_SELECTION_HANDLE ];
secondary.actor.SetPosition( secondary.x + scrollPosition.x,
- secondary.y + scrollPosition.y + secondary.cursorHeight );
+ secondary.y + scrollPosition.y + secondary.lineHeight );
CreateHighlight();
UpdateHighlight();
mActiveLayer.Add( mSecondaryCursor);
}
}
+ else
+ {
+ UnparentAndReset( mSecondaryCursor );
+ }
}
}
mGrabDisplacementY += gesture.displacement.y;
float x = mCursor[PRIMARY_CURSOR].x + mGrabDisplacementX;
- float y = mCursor[PRIMARY_CURSOR].y + mCursor[PRIMARY_CURSOR].height*0.5f + mGrabDisplacementY;
+ float y = mCursor[PRIMARY_CURSOR].y + mCursor[PRIMARY_CURSOR].lineHeight*0.5f + mGrabDisplacementY;
if( Gesture::Started == gesture.state ||
Gesture::Continuing == gesture.state )
return mImpl->mActiveCursor;
}
-void Decorator::SetPosition( Cursor cursor, float x, float y, float height )
+void Decorator::SetPosition( Cursor cursor, float x, float y, float cursorHeight, float lineHeight )
{
// Adjust grab handle displacement
mImpl->mGrabDisplacementX -= x - mImpl->mCursor[cursor].x;
mImpl->mCursor[cursor].x = x;
mImpl->mCursor[cursor].y = y;
- mImpl->mCursor[cursor].height = height;
+ mImpl->mCursor[cursor].cursorHeight = cursorHeight;
+ mImpl->mCursor[cursor].lineHeight = lineHeight;
}
-void Decorator::GetPosition( Cursor cursor, float& x, float& y, float& height ) const
+void Decorator::GetPosition( Cursor cursor, float& x, float& y, float& cursorHeight, float& lineHeight ) const
{
x = mImpl->mCursor[cursor].x;
y = mImpl->mCursor[cursor].y;
- height = mImpl->mCursor[cursor].height;
+ cursorHeight = mImpl->mCursor[cursor].cursorHeight;
+ lineHeight = mImpl->mCursor[cursor].lineHeight;
}
void Decorator::SetColor( Cursor cursor, const Dali::Vector4& color )
{
mImpl->mSelectionHandle[handle].x = x;
mImpl->mSelectionHandle[handle].y = y;
- mImpl->mSelectionHandle[handle].cursorHeight = height;
+ mImpl->mSelectionHandle[handle].lineHeight = height;
}
void Decorator::GetPosition( SelectionHandle handle, float& x, float& y, float& height ) const
{
x = mImpl->mSelectionHandle[handle].x;
y = mImpl->mSelectionHandle[handle].y;
- height = mImpl->mSelectionHandle[handle].cursorHeight;
+ height = mImpl->mSelectionHandle[handle].lineHeight;
}
void Decorator::SetImage( SelectionHandle handle, SelectionHandleState state, Dali::Image image )
* @param[in] cursor The cursor to set.
* @param[in] x The x position relative to the top-left of the parent control.
* @param[in] y The y position relative to the top-left of the parent control.
- * @param[in] height The logical height of the cursor.
+ * @param[in] cursorHeight The logical height of the cursor.
+ * @param[in] lineHeight The logical height of the line.
*/
- void SetPosition( Cursor cursor, float x, float y, float height );
+ void SetPosition( Cursor cursor, float x, float y, float cursorHeight, float lineHeight );
/**
* @brief Retrieves the position of a cursor.
* @param[in] cursor The cursor to get.
* @param[out] x The x position relative to the top-left of the parent control.
* @param[out] y The y position relative to the top-left of the parent control.
- * @param[out] height The logical height of the cursor.
+ * @param[out] cursorHeight The logical height of the cursor.
+ * @param[out] lineHeight The logical height of the line.
*/
- void GetPosition( Cursor cursor, float& x, float& y, float& height ) const;
+ void GetPosition( Cursor cursor, float& x, float& y, float& cursorHeight, float& lineHeight ) const;
/**
* @brief Sets the color for a cursor.
* @param[in] handle The handle to set.
* @param[in] x The x position relative to the top-left of the parent control.
* @param[in] y The y position relative to the top-left of the parent control.
- * @param[in] cursorHeight The logical cursor height at this position.
+ * @param[in] lineHeight The logical line height at this position.
*/
- void SetPosition( SelectionHandle handle, float x, float y, float cursorHeight );
+ void SetPosition( SelectionHandle handle, float x, float y, float lineHeight );
/**
* @brief Retrieves the position of a selection handle.
float yPosition = event.p3.mFloat - alignmentOffset.y;
float height(0.0f);
GetClosestCursorPosition( mPrimaryCursorPosition, xPosition, yPosition, height );
- mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height );
+ mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height, height ); // TODO: To be fixed in the next patch.
mUpdateCursorPosition = false;
mDecoratorUpdated = true;
GetClosestCursorPosition( mPrimaryCursorPosition, xPosition, yPosition, height );
- mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height );
+ mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height, height ); // TODO: To be fixed in the next patch.
+
//mDecorator->HidePopup();
ChangeState ( EDITING );
mDecoratorUpdated = true;
}
}
- mDecorator->SetPosition( PRIMARY_CURSOR, visualX, visualY, height );
+ mDecorator->SetPosition( PRIMARY_CURSOR, visualX, visualY, height, height ); // TODO: To be fixed in the next patch.
mDecoratorUpdated = true;
}