summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
70d097e)
* Fixes the position of the cursors, handles and highlight box.
Change-Id: I10d6931f0b0c2051915dfc1c0ff3eecf6f4b0f1f
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
mBoundingBox(),
mHighlightColor( LIGHT_BLUE ),
mHighlightPosition( Vector2::ZERO ),
mBoundingBox(),
mHighlightColor( LIGHT_BLUE ),
mHighlightPosition( Vector2::ZERO ),
+ mHighlightSize( Vector2::ZERO ),
+ mControlSize( Vector2::ZERO ),
+ mHighlightOutlineOffset( 0.f ),
mActiveCursor( ACTIVE_CURSOR_NONE ),
mCursorBlinkInterval( CURSOR_BLINK_INTERVAL ),
mCursorBlinkDuration( 0.0f ),
mActiveCursor( ACTIVE_CURSOR_NONE ),
mCursorBlinkInterval( CURSOR_BLINK_INTERVAL ),
mCursorBlinkDuration( 0.0f ),
if ( mHighlightActor )
{
// Sets the position of the highlight actor inside the decorator.
if ( mHighlightActor )
{
// Sets the position of the highlight actor inside the decorator.
- mHighlightActor.SetPosition( mHighlightPosition.x,
- mHighlightPosition.y );
+ mHighlightActor.SetPosition( mHighlightPosition.x + mHighlightOutlineOffset,
+ mHighlightPosition.y + mHighlightOutlineOffset );
const unsigned int numberOfQuads = mHighlightQuadList.Count();
if( 0u != numberOfQuads )
const unsigned int numberOfQuads = mHighlightQuadList.Count();
if( 0u != numberOfQuads )
Vector2 mHighlightPosition; ///< The position of the highlight actor.
Size mHighlightSize; ///< The size of the highlighted text.
Size mControlSize; ///< The control's size. Set by the Relayout.
Vector2 mHighlightPosition; ///< The position of the highlight actor.
Size mHighlightSize; ///< The size of the highlighted text.
Size mControlSize; ///< The control's size. Set by the Relayout.
+ float mHighlightOutlineOffset; ///< The outline's offset.
unsigned int mActiveCursor;
unsigned int mCursorBlinkInterval;
unsigned int mActiveCursor;
unsigned int mCursorBlinkInterval;
*( mImpl->mHighlightQuadList.Begin() + index ) = quad;
}
*( mImpl->mHighlightQuadList.Begin() + index ) = quad;
}
-void Decorator::SetHighLightBox( const Vector2& position, const Size& size )
+void Decorator::SetHighLightBox( const Vector2& position, const Size& size, float outlineOffset )
{
mImpl->mHighlightPosition = position;
mImpl->mHighlightSize = size;
{
mImpl->mHighlightPosition = position;
mImpl->mHighlightSize = size;
+ mImpl->mHighlightOutlineOffset = outlineOffset;
}
void Decorator::ClearHighlights()
{
mImpl->mHighlightQuadList.Clear();
mImpl->mHighlightPosition = Vector2::ZERO;
}
void Decorator::ClearHighlights()
{
mImpl->mHighlightQuadList.Clear();
mImpl->mHighlightPosition = Vector2::ZERO;
+ mImpl->mHighlightOutlineOffset = 0.f;
}
void Decorator::ResizeHighlightQuads( unsigned int numberOfQuads )
}
void Decorator::ResizeHighlightQuads( unsigned int numberOfQuads )
*
* @param[in] position The position of the highlighted text in decorator's coords.
* @param[in] size The size of the highlighted text.
*
* @param[in] position The position of the highlighted text in decorator's coords.
* @param[in] size The size of the highlighted text.
+ * @param[in] outlineOffset The outline's offset.
*/
void SetHighLightBox( const Vector2& position,
*/
void SetHighLightBox( const Vector2& position,
+ const Size& size,
+ float outlineOffset );
/**
* @brief Removes all of the previously added highlights.
/**
* @brief Removes all of the previously added highlights.
lastFontId = glyph.fontId; // Prevents searching for existing blocksizes when string of the same fontId.
}
lastFontId = glyph.fontId; // Prevents searching for existing blocksizes when string of the same fontId.
}
- if( isOutline&& ( 0u != slotOutline.mImageId ) ) // invalid slot id, glyph has failed to be added to atlas
+ if( isOutline && ( 0u != slotOutline.mImageId ) ) // invalid slot id, glyph has failed to be added to atlas
{
GenerateMesh( glyph,
position,
{
GenerateMesh( glyph,
position,
const SelectionBoxInfo& firstSelectionBoxLineInfo = *( selectionBoxLinesInfo.Begin() );
highLightPosition.y = firstSelectionBoxLineInfo.lineOffset;
const SelectionBoxInfo& firstSelectionBoxLineInfo = *( selectionBoxLinesInfo.Begin() );
highLightPosition.y = firstSelectionBoxLineInfo.lineOffset;
- mEventData->mDecorator->SetHighLightBox( highLightPosition, highLightSize );
+ mEventData->mDecorator->SetHighLightBox( highLightPosition, highLightSize, static_cast<float>( mModel->GetOutlineWidth() ) );
if( !mEventData->mDecorator->IsSmoothHandlePanEnabled() )
{
if( !mEventData->mDecorator->IsSmoothHandlePanEnabled() )
{
Text::GetCursorPosition( parameters,
cursorInfo );
Text::GetCursorPosition( parameters,
cursorInfo );
+ // Adds Outline offset.
+ const float outlineWidth = static_cast<float>( mModel->GetOutlineWidth() );
+ cursorInfo.primaryPosition.x += outlineWidth;
+ cursorInfo.primaryPosition.y += outlineWidth;
+ cursorInfo.secondaryPosition.x += outlineWidth;
+ cursorInfo.secondaryPosition.y += outlineWidth;
+
if( isMultiLine )
{
// If the text is editable and multi-line, the cursor position after a white space shouldn't exceed the boundaries of the text control.
if( isMultiLine )
{
// If the text is editable and multi-line, the cursor position after a white space shouldn't exceed the boundaries of the text control.
const Vector<CharacterIndex>& glyphsToCharactersMap = mImpl->mModel->mVisualModel->mGlyphsToCharacters;
const Vector<Length>& charactersPerGlyph = mImpl->mModel->mVisualModel->mCharactersPerGlyph;
const Character* const textBuffer = mImpl->mModel->mLogicalModel->mText.Begin();
const Vector<CharacterIndex>& glyphsToCharactersMap = mImpl->mModel->mVisualModel->mGlyphsToCharacters;
const Vector<Length>& charactersPerGlyph = mImpl->mModel->mVisualModel->mCharactersPerGlyph;
const Character* const textBuffer = mImpl->mModel->mLogicalModel->mText.Begin();
- float outlineWidth = mImpl->mModel->GetOutlineWidth();
+ const float outlineWidth = static_cast<float>( mImpl->mModel->GetOutlineWidth() );
// Set the layout parameters.
Layout::Parameters layoutParameters( size,
// Set the layout parameters.
Layout::Parameters layoutParameters( size,