diff --git a/src/apps/haiku-depot/textview/TextDocumentLayout.cpp b/src/apps/haiku-depot/textview/TextDocumentLayout.cpp index cd7b1d7905..aa7ef69d27 100644 --- a/src/apps/haiku-depot/textview/TextDocumentLayout.cpp +++ b/src/apps/haiku-depot/textview/TextDocumentLayout.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013, Stephan Aßmus . + * Copyright 2013-2014, Stephan Aßmus . * All rights reserved. Distributed under the terms of the MIT License. */ @@ -337,7 +337,7 @@ TextDocumentLayout::_ParagraphLayoutIndexForOffset(int32& textOffset) const ParagraphLayoutInfo& info = fParagraphLayouts.ItemAtFast(i); int32 length = info.layout->CountGlyphs(); - if (textOffset > length) { + if (textOffset >= length) { textOffset -= length; continue; } diff --git a/src/apps/haiku-depot/textview/TextDocumentLayout.h b/src/apps/haiku-depot/textview/TextDocumentLayout.h index 2e3df4bdfb..89c5111f21 100644 --- a/src/apps/haiku-depot/textview/TextDocumentLayout.h +++ b/src/apps/haiku-depot/textview/TextDocumentLayout.h @@ -1,5 +1,5 @@ /* - * Copyright 2013, Stephan Aßmus . + * Copyright 2013-2014, Stephan Aßmus . * All rights reserved. Distributed under the terms of the MIT License. */ #ifndef TEXT_DOCUMENT_LAYOUT_H