return false;
}
+ unsigned int oldPos = eventData->mPrimaryCursorPosition;
+
if(eventData->mDecorator)
{
for(std::vector<Event>::iterator iter = eventData->mEventQueue.begin();
{
// Updates the cursor position and scrolls the text to make it visible.
CursorInfo cursorInfo;
+
// Calculate the cursor position from the new cursor index.
impl.GetCursorPosition(eventData->mPrimaryCursorPosition, cursorInfo);
- if(nullptr != impl.mEditableControlInterface)
+ //only emit the event if the cursor is moved in current function.
+ if(nullptr != impl.mEditableControlInterface && eventData->mEventQueue.size() > 0)
{
- impl.mEditableControlInterface->CursorMoved(eventData->mPrimaryCursorPosition);
+ impl.mEditableControlInterface->CursorPositionChanged(oldPos, eventData->mPrimaryCursorPosition);
}
if(eventData->mUpdateCursorHookPosition)
const LineRun& line = *(visualModel->mLines.Begin() + previousLineIndex);
// Get the next hit 'y' point.
- const float hitPointY = cursorInfo.lineOffset - 0.5f * (line.ascender - line.descender);
+ const float hitPointY = cursorInfo.lineOffset - 0.5f * GetLineHeight(line);
// Use the cursor hook position 'x' and the next hit 'y' position to calculate the new cursor index.
bool matchedCharacter = false;
const LineRun& line = *(visualModel->mLines.Begin() + lineIndex + 1u);
// Get the next hit 'y' point.
- const float hitPointY = cursorInfo.lineOffset + cursorInfo.lineHeight + 0.5f * (line.ascender - line.descender);
+ const float hitPointY = cursorInfo.lineOffset + cursorInfo.lineHeight + 0.5f * GetLineHeight(line);
// Use the cursor hook position 'x' and the next hit 'y' position to calculate the new cursor index.
bool matchedCharacter = false;