From 8346431fdd11e4df458626e8f51483429a8ee9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 22 Jan 2014 22:34:33 +0100 Subject: [PATCH] TextDocumentLayout: Fixed finding paragraph by line index. --- src/apps/haiku-depot/textview/TextDocumentLayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/haiku-depot/textview/TextDocumentLayout.cpp b/src/apps/haiku-depot/textview/TextDocumentLayout.cpp index aa7ef69d27..fc60ac0083 100644 --- a/src/apps/haiku-depot/textview/TextDocumentLayout.cpp +++ b/src/apps/haiku-depot/textview/TextDocumentLayout.cpp @@ -358,7 +358,7 @@ TextDocumentLayout::_ParagraphLayoutIndexForLineIndex(int32& lineIndex) const ParagraphLayoutInfo& info = fParagraphLayouts.ItemAtFast(i); int32 lineCount = info.layout->CountLines(); - if (lineIndex > lineCount) { + if (lineIndex >= lineCount) { lineIndex -= lineCount; continue; }