Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions indra/llui/lllineeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,13 @@ void LLLineEditor::setCursor( S32 pos )
S32 pixels_after_scroll = findPixelNearestPos();
if( pixels_after_scroll > mTextRightEdge )
{
S32 width_chars_to_left = mGLFont->getWidth(mText.getWString().c_str(), 0, mScrollHPos);
S32 last_visible_char = mGLFont->maxDrawableChars(mText.getWString().c_str(), llmax(0.f, (F32)(mTextRightEdge - mTextLeftEdge + width_chars_to_left)));
const LLWString& wtext = mText.getWString();
S32 width_chars_to_left = mGLFont->getWidth(wtext.c_str(), 0, mScrollHPos);
S32 last_visible_char = mGLFont->maxDrawableChars(wtext.c_str(), llmax(0.f, (F32)(mTextRightEdge - mTextLeftEdge + width_chars_to_left)));
// character immediately to left of cursor should be last one visible (SCROLL_INCREMENT_ADD will scroll in more characters)
// or first character if cursor is at beginning
S32 new_last_visible_char = llmax(0, getCursor() - 1);
S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mTextRightEdge - mTextLeftEdge), mText.length(), new_last_visible_char);
S32 min_scroll = mGLFont->firstDrawableChar(wtext.c_str(), (F32)(mTextRightEdge - mTextLeftEdge), mText.length(), new_last_visible_char);
if (old_cursor_pos == last_visible_char)
{
mScrollHPos = llmin(mText.length(), llmax(min_scroll, mScrollHPos + SCROLL_INCREMENT_ADD));
Expand Down
5 changes: 4 additions & 1 deletion indra/newview/llpanelprofilepicks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,10 @@ bool LLPanelProfilePick::postBuild()
void LLPanelProfilePick::reshape(S32 width, S32 height, bool called_from_parent)
{
LLPanelProfilePropertiesProcessorTab::reshape(width, height, called_from_parent);
mPickLocation->setCursor(0);
if (mPickLocation)
{
mPickLocation->setCursor(0);
}
}

void LLPanelProfilePick::onDescriptionFocusReceived()
Expand Down
16 changes: 8 additions & 8 deletions indra/newview/llpanelprofilepicks.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ class LLPanelProfilePick

protected:

LLTextureCtrl* mSnapshotCtrl;
LLLineEditor* mPickName;
LLTextEditor* mPickDescription;
LLLineEditor* mPickLocation;
LLButton* mSetCurrentLocationButton;
LLButton* mSaveButton;
LLButton* mCreateButton;
LLButton* mCancelButton;
LLTextureCtrl* mSnapshotCtrl = nullptr;
LLLineEditor* mPickName = nullptr;
LLTextEditor* mPickDescription = nullptr;
LLLineEditor* mPickLocation = nullptr;
LLButton* mSetCurrentLocationButton = nullptr;
LLButton* mSaveButton = nullptr;
LLButton* mCreateButton = nullptr;
LLButton* mCancelButton = nullptr;

LLVector3d mPosGlobal;
LLUUID mParcelId;
Expand Down
Loading