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:
@@ -112,8 +112,7 @@ TextDocumentLayout::LineIndexForOffset(int32 textOffset)
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
int32 lineIndex = 0;
|
int32 lineIndex = 0;
|
||||||
for (int32 i = 0; i < index; i++) {
|
for (int32 i = 0; i < index; i++) {
|
||||||
lineIndex += fParagraphLayouts.ItemAtFast(index)
|
lineIndex += fParagraphLayouts.ItemAtFast(i).layout->CountLines();
|
||||||
.layout->CountLines();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const ParagraphLayoutInfo& info = fParagraphLayouts.ItemAtFast(index);
|
const ParagraphLayoutInfo& info = fParagraphLayouts.ItemAtFast(index);
|
||||||
|
|||||||
Reference in New Issue
Block a user