Length yLineOffset = 0;
Length prevLineIndex = 0;
LineIndex lineIndex;
- Length numberOfLines;
for(uint32_t i = 0, glyphSize = glyphs.Size(); i < glyphSize; ++i)
{
const bool isDefaultBackgroundColor = (0u == backgroundColorIndex);
const Vector4& backgroundColor = isDefaultBackgroundColor ? defaultBackgroundColor : *(backgroundColorsBuffer + backgroundColorIndex - 1u);
- textVisualModel->GetNumberOfLines(i, 1, lineIndex, numberOfLines);
+ lineIndex = textVisualModel->GetLineOfGlyph(i);
Length lineHeight = CalculateBackgroundLineHeight(lineRun[lineIndex]);
if(lineIndex != prevLineIndex)
}
}
+LineIndex VisualModel::GetLineOfGlyph( GlyphIndex glyphIndex )
+{
+ const CharacterIndex characterIndex = *(mGlyphsToCharacters.Begin() + glyphIndex);
+ return GetLineOfCharacter(characterIndex);
+}
+
void VisualModel::GetLinesOfGlyphRange(LineRun* lines,
GlyphIndex glyphIndex,
Length numberOfGlyphs) const
Length& numberOfLines) const;
/**
+ * @brief Retrieves the line index where the glyph is laid-out.
+ *
+ * @param[in] glyphIndex The glyph's index.
+ *
+ * @return The line index.
+ */
+ LineIndex GetLineOfGlyph(GlyphIndex glyphIndex);
+
+ /**
* @brief Retrieves the lines where the given range of glyphs is laid out.
*
* The size of the @p lines buffer needs to be big enough to copy the @p numberOfLines.