{
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)
{
{
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;
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;
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.