diff options
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llbutton.cpp | 17 | ||||
| -rw-r--r-- | indra/llui/lllineeditor.cpp | 6 | ||||
| -rw-r--r-- | indra/llui/llmenugl.cpp | 1 | 
3 files changed, 10 insertions, 14 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 4944ed4fe7..14b77925f2 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -771,12 +771,7 @@ void LLButton::draw()  			center_x++;  		} -		S32 text_width_delta = overlay_width + 1; -		// if image paddings set, they should participate in scaling process -		S32 image_size_delta = mImageOverlayTopPad + mImageOverlayBottomPad; -		overlay_width = overlay_width - image_size_delta; -		overlay_height = overlay_height - image_size_delta; - +		center_y += (mImageOverlayBottomPad - mImageOverlayTopPad);  		// fade out overlay images on disabled buttons  		LLColor4 overlay_color = mImageOverlayColor.get();  		if (!enabled) @@ -788,10 +783,9 @@ void LLButton::draw()  		switch(mImageOverlayAlignment)  		{  		case LLFontGL::LEFT: -			text_left += overlay_width + mImageOverlayRightPad + 1; -			text_width -= text_width_delta; +			text_left += overlay_width + 1;  			mImageOverlay->draw( -				mLeftHPad,  +				mImageOverlayLeftPad,  				center_y - (overlay_height / 2),   				overlay_width,   				overlay_height,  @@ -806,10 +800,9 @@ void LLButton::draw()  				overlay_color);  			break;  		case LLFontGL::RIGHT: -			text_right -= overlay_width + mImageOverlayLeftPad+ 1; -			text_width -= text_width_delta; +			text_right -= overlay_width + 1;  			mImageOverlay->draw( -				getRect().getWidth() - mRightHPad - overlay_width,  +				getRect().getWidth() - mImageOverlayRightPad - overlay_width,  				center_y - (overlay_height / 2),   				overlay_width,   				overlay_height,  diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 00376cc4dd..30b09352d8 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -430,12 +430,16 @@ void LLLineEditor::setCursor( S32 pos )  	S32 old_cursor_pos = getCursor();  	mCursorPos = llclamp( pos, 0, mText.length()); +	// position of end of next character after cursor  	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)));  -		S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mTextRightEdge - mTextLeftEdge), mText.length(), getCursor()); +		// 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);  		if (old_cursor_pos == last_visible_char)  		{  			mScrollHPos = llmin(mText.length(), llmax(min_scroll, mScrollHPos + SCROLL_INCREMENT_ADD)); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 7fa9a88059..d18abbfb2f 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3941,7 +3941,6 @@ BOOL LLContextMenu::appendContextSubMenu(LLContextMenu *menu)  	item = LLUICtrlFactory::create<LLContextMenuBranch>(p);  	LLMenuGL::sMenuContainer->addChild(item->getBranch()); -	item->setFont( LLFontGL::getFontSansSerif() );  	return append( item );  }  | 
