From f8627d43423d6e2383b13dfa98e26849a51ce39a Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 18 Jun 2014 20:23:34 +0300 Subject: MAINT-3967 FIXED Up arrow key does not move the cursor up in chat field. --- indra/llui/lltexteditor.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 3a546d041a..49e1991b01 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1308,13 +1308,22 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) case KEY_END: endOfLine(); - if (!mDrawRightmostCursor) { - mDrawRightmostCursor = true; - if (mCursorPos + 1 < getLength()) + S32 last_line_index = mLineInfoList.size() - 1; + if (getLineNumFromDocIndex(mCursorPos, true) < last_line_index) { + mDrawRightmostCursor = true; setCursorPos(mCursorPos + 1); } + else if (last_line_index > 0) // only for two and more lines + { + S32 prev_line_width = mLineInfoList[last_line_index - 1].mRect.getWidth(); + S32 last_line_width = mLineInfoList[last_line_index].mRect.getWidth(); + if (prev_line_width <= last_line_width) + { + mDrawRightmostCursor = true; + } + } } break; -- cgit v1.2.3