X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-selection-handle-controller.cpp;h=cf63deb1a10d353c692cb9929d44295fe493f86d;hb=0231146907c21e934102222180a1a94b36ba0e65;hp=06017501e4b055909b48bb764dbee7d883e0f883;hpb=2ca1c3856ce848a94f54444f1014a820e91ee207;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-selection-handle-controller.cpp b/dali-toolkit/internal/text/text-selection-handle-controller.cpp index 0601750..cf63deb 100644 --- a/dali-toolkit/internal/text/text-selection-handle-controller.cpp +++ b/dali-toolkit/internal/text/text-selection-handle-controller.cpp @@ -144,9 +144,7 @@ void SelectionHandleController::Reposition(Controller::Impl& impl) lineRun += firstLineIndex; - // The line height is the addition of the line ascender and the line descender. - // However, the line descender has a negative value, hence the subtraction. - selectionBoxInfo->lineHeight = lineRun->ascender - lineRun->descender; + selectionBoxInfo->lineHeight = GetLineHeight(*lineRun); GlyphIndex lastGlyphOfLine = lineRun->glyphRun.glyphIndex + lineRun->glyphRun.numberOfGlyphs - 1u; @@ -275,9 +273,7 @@ void SelectionHandleController::Reposition(Controller::Impl& impl) // Update the line's vertical offset. selectionBoxInfo->lineOffset = currentLineOffset + currentLineHeight; - // The line height is the addition of the line ascender and the line descender. - // However, the line descender has a negative value, hence the subtraction. - selectionBoxInfo->lineHeight = lineRun->ascender - lineRun->descender; + selectionBoxInfo->lineHeight = GetLineHeight(*lineRun); } } } @@ -495,6 +491,9 @@ void SelectionHandleController::Reposition(Controller::Impl& impl, float visualX if(characterHit || (Controller::NoTextTap::HIGHLIGHT == action)) { + uint32_t oldStart = eventData->mLeftSelectionPosition; + uint32_t oldEnd = eventData->mRightSelectionPosition; + impl.ChangeState(EventData::SELECTING); eventData->mLeftSelectionPosition = selectionStart; @@ -514,6 +513,11 @@ void SelectionHandleController::Reposition(Controller::Impl& impl, float visualX // Cursor to be positioned at end of selection so if selection interrupted and edit mode restarted the cursor will be at end of selection eventData->mPrimaryCursorPosition = std::max(eventData->mLeftSelectionPosition, eventData->mRightSelectionPosition); + + if(impl.mSelectableControlInterface != nullptr) + { + impl.mSelectableControlInterface->SelectionChanged(oldStart, oldEnd, eventData->mLeftSelectionPosition, eventData->mRightSelectionPosition); + } } else if(Controller::NoTextTap::SHOW_SELECTION_POPUP == action) {