TextDocumentLayout: Fixed LineIndexForOffset()
It stepped over a wrong number of lines when skipping to the ParagraphLayout containing the text offset.
This commit is contained in:
parent
287e53bd89
commit
1d70e2ccd4
@ -112,8 +112,7 @@ TextDocumentLayout::LineIndexForOffset(int32 textOffset)
|
||||
if (index >= 0) {
|
||||
int32 lineIndex = 0;
|
||||
for (int32 i = 0; i < index; i++) {
|
||||
lineIndex += fParagraphLayouts.ItemAtFast(index)
|
||||
.layout->CountLines();
|
||||
lineIndex += fParagraphLayouts.ItemAtFast(i).layout->CountLines();
|
||||
}
|
||||
|
||||
const ParagraphLayoutInfo& info = fParagraphLayouts.ItemAtFast(index);
|
||||
|
Loading…
x
Reference in New Issue
Block a user