Commits

Scott Lawrence committed 992de16 Merge

merge changes for storm-320

Comments (0)

Files changed (1)

indra/llui/lltextbase.cpp

 			pos = segment_line_start + offset;
 			break;
 		}
-		else if (hit_past_end_of_line && segmentp->getEnd() > line_iter->mDocIndexEnd - 1)	
+		else if (hit_past_end_of_line && segmentp->getEnd() >= line_iter->mDocIndexEnd)
 		{
 			// segment wraps to next line, so just set doc pos to the end of the line
-			// segment wraps to next line, so just set doc pos to start of next line (represented by mDocIndexEnd)
-			pos = llmin(getLength(), line_iter->mDocIndexEnd);
+			pos = llclamp(line_iter->mDocIndexEnd - 1, 0, getLength());
 			break;
 		}
 		start_x += text_width;