{
namespace Text
{
+float GetLineHeight(const LineRun lineRun)
+{
+ // The line height is the addition of the line ascender, the line descender and the line spacing.
+ // However, the line descender has a negative value, hence the subtraction.
+ return lineRun.ascender - lineRun.descender + lineRun.lineSpacing;
+}
namespace Layout
{
namespace
layoutSize.width = layoutParameters.boundingBox.width;
if(layoutSize.height < Math::MACHINE_EPSILON_1000)
{
- layoutSize.height += (lineRun->ascender + -lineRun->descender) + lineRun->lineSpacing;
+ layoutSize.height += GetLineHeight(*lineRun);
}
const Vector<BidirectionalLineInfoRun>& bidirectionalLinesInfo = layoutParameters.textModel->mLogicalModel->mBidirectionalLineInfo;
layoutSize.width = lineRun.width;
}
- layoutSize.height += (lineRun.ascender + -lineRun.descender) + lineRun.lineSpacing;
+ layoutSize.height += GetLineHeight(lineRun);
}
/**
lineRun.lineSpacing += mDefaultLineSpacing;
- layoutSize.height += (lineRun.ascender + -lineRun.descender) + lineRun.lineSpacing;
+ layoutSize.height += GetLineHeight(lineRun);
}
/**
layoutSize.width = line.width;
}
- layoutSize.height += (line.ascender + -line.descender) + line.lineSpacing;
+ layoutSize.height += GetLineHeight(line);
}
}
linesBuffer[lineIndex].ellipsis = false;
}
numberOfLines--;
- lineIndex++;
}
linesBuffer[0u].ellipsis = true;
}