X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fcursor-helper-functions.cpp;h=c2d35d9be5e1731d64384d027632ec637c2a4fba;hb=8b8f6778185df349e22134bc20f4f19afb696267;hp=1df142c7c3ebe01873a6b8ac5e240a931f47ccef;hpb=2ca1c3856ce848a94f54444f1014a820e91ee207;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/cursor-helper-functions.cpp b/dali-toolkit/internal/text/cursor-helper-functions.cpp index 1df142c..c2d35d9 100644 --- a/dali-toolkit/internal/text/cursor-helper-functions.cpp +++ b/dali-toolkit/internal/text/cursor-helper-functions.cpp @@ -155,9 +155,7 @@ LineIndex GetClosestLine(VisualModelPtr visualModel, { const LineRun& lineRun = *it; - // 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. - totalHeight += lineRun.ascender - lineRun.descender; + totalHeight += GetLineHeight(lineRun); if(visualY < totalHeight) { @@ -186,9 +184,7 @@ float CalculateLineOffset(const Vector& lines, { const LineRun& lineRun = *it; - // 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. - offset += lineRun.ascender - lineRun.descender; + offset += GetLineHeight(lineRun); } return offset; @@ -495,9 +491,7 @@ void GetCursorPosition(GetCursorPositionParameters& parameters, cursorInfo.lineOffset = CalculateLineOffset(parameters.visualModel->mLines, newLineIndex); - // 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. - cursorInfo.lineHeight = newLine.ascender - newLine.descender; + cursorInfo.lineHeight = GetLineHeight(newLine); // Set the primary cursor's height. cursorInfo.primaryCursorHeight = cursorInfo.lineHeight; @@ -543,9 +537,7 @@ void GetCursorPosition(GetCursorPositionParameters& parameters, cursorInfo.lineOffset = CalculateLineOffset(parameters.visualModel->mLines, lineIndex); - // 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. - cursorInfo.lineHeight = line.ascender - line.descender; + cursorInfo.lineHeight = GetLineHeight(line); // Calculate the primary cursor.