ParagraphLayout: Off-by-one error in LastOffsetOnLine()

This commit is contained in:
Stephan Aßmus 2014-01-22 23:17:48 +01:00
parent 433f08a481
commit 937ad5c6b8

View File

@ -328,8 +328,9 @@ ParagraphLayout::LastOffsetOnLine(int32 lineIndex)
if (lineIndex < 0)
lineIndex = 0;
if (lineIndex >= fLineInfos.CountItems() - 1)
return CountGlyphs();
return CountGlyphs() - 1;
return fLineInfos.ItemAt(lineIndex + 1).textOffset - 1;
}