summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2009-10-28 17:12:47 -0700
committerLeyla Farazha <leyla@lindenlab.com>2009-10-28 17:12:47 -0700
commit437449044583d50c8cad694e65e5a4a23a55d768 (patch)
treec7637a8dbc31d933ca05e999eea7f9fd34daa305 /indra/llui
parent9426de7e10fa7cfe84048ae7dd58a793e981ee33 (diff)
parentd993ce14d83530544c0e0f05af10d235999d9a5f (diff)
tab container fixes..
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 653505a12e..2b1d677ffb 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -419,9 +419,6 @@ void LLTextBase::drawCursor()
return;
}
- if (!mTextRect.contains(cursor_rect))
- return;
-
// Draw the cursor
// (Flash the cursor every half second starting a fixed time after the last keystroke)
F32 elapsed = mCursorBlinkTimer.getElapsedTimeF32();
@@ -2381,7 +2378,6 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
{
if (text[last_char] == '\n')
{
- last_char++;
break;
}
}
@@ -2401,9 +2397,14 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
// If at the beginning of a line, and a single character won't fit, draw it anyway
num_chars = 1;
}
- if (mStart + segment_offset + num_chars == mEditor.getLength())
+
+ // include *either* the EOF or newline character in this run of text
+ // but not both
+ S32 last_char_in_run = mStart + segment_offset + num_chars;
+ // check length first to avoid indexing off end of string
+ if (last_char_in_run >= mEditor.getLength()
+ || text[last_char_in_run] == '\n')
{
- // include terminating NULL
num_chars++;
}
return num_chars;