ParagraphLayout: Off-by-one error in LastOffsetOnLine()
This commit is contained in:
@@ -328,8 +328,9 @@ ParagraphLayout::LastOffsetOnLine(int32 lineIndex)
|
|||||||
|
|
||||||
if (lineIndex < 0)
|
if (lineIndex < 0)
|
||||||
lineIndex = 0;
|
lineIndex = 0;
|
||||||
|
|
||||||
if (lineIndex >= fLineInfos.CountItems() - 1)
|
if (lineIndex >= fLineInfos.CountItems() - 1)
|
||||||
return CountGlyphs();
|
return CountGlyphs() - 1;
|
||||||
|
|
||||||
return fLineInfos.ItemAt(lineIndex + 1).textOffset - 1;
|
return fLineInfos.ItemAt(lineIndex + 1).textOffset - 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user