From 09add95e314652bdb55200ad62a75c42326d69b4 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 1 Apr 2010 13:42:42 -0700
Subject: EXT-6307 World Map: field of view triangle rotates

reviewed by Leyla
---
 indra/newview/llworldmapview.cpp | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

(limited to 'indra')

diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 7afe81b436..0c37bb6eb1 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -886,28 +886,36 @@ void LLWorldMapView::drawFrustum()
 	F32 half_width_meters = far_clip_meters * tan( horiz_fov / 2 );
 	F32 half_width_pixels = half_width_meters * meters_to_pixels;
 	
-	F32 ctr_x = getRect().getWidth() * 0.5f + sPanX;
-	F32 ctr_y = getRect().getHeight() * 0.5f + sPanY;
+	F32 ctr_x = getLocalRect().getWidth() * 0.5f + sPanX;
+	F32 ctr_y = getLocalRect().getHeight() * 0.5f + sPanY;
 
 	gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
 
 	// Since we don't rotate the map, we have to rotate the frustum.
 	gGL.pushMatrix();
+	{
 		gGL.translatef( ctr_x, ctr_y, 0 );
-		glRotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f);
 
 		// Draw triangle with more alpha in far pixels to make it 
 		// fade out in distance.
 		gGL.begin( LLRender::TRIANGLES  );
+		{
+			LLVector2 cam_lookat(LLViewerCamera::instance().getAtAxis().mV[VX], LLViewerCamera::instance().getAtAxis().mV[VY]);
+			LLVector2 cam_left(LLViewerCamera::instance().getLeftAxis().mV[VX], LLViewerCamera::instance().getLeftAxis().mV[VY]);
+
 			gGL.color4f(1.f, 1.f, 1.f, 0.25f);
 			gGL.vertex2f( 0, 0 );
 
 			gGL.color4f(1.f, 1.f, 1.f, 0.02f);
-			gGL.vertex2f( -half_width_pixels, far_clip_pixels );
+			
+			LLVector2 vert = cam_lookat * far_clip_pixels + cam_left * half_width_pixels;
+			gGL.vertex2f(vert.mV[VX], vert.mV[VY]);
 
-			gGL.color4f(1.f, 1.f, 1.f, 0.02f);
-			gGL.vertex2f(  half_width_pixels, far_clip_pixels );
+			vert = cam_lookat * far_clip_pixels - cam_left * half_width_pixels;
+			gGL.vertex2f(vert.mV[VX], vert.mV[VY]);
+		}
 		gGL.end();
+	}
 	gGL.popMatrix();
 }
 
-- 
cgit v1.2.3


From 2be2fdca5c334b787b8019d7226a48e1d5eaec91 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 1 Apr 2010 14:08:49 -0700
Subject: EXT-3606 - Script editor window: next line not indenting if current
 line wraps

---
 indra/llui/lltexteditor.cpp                                     | 2 +-
 indra/newview/skins/default/xui/en/floater_test_text_editor.xml | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

(limited to 'indra')

diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 7d230f7d42..94c7ebec2a 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2334,7 +2334,7 @@ void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wo
 void LLTextEditor::autoIndent()
 {
 	// Count the number of spaces in the current line
-	S32 line = getLineNumFromDocIndex(mCursorPos);
+	S32 line = getLineNumFromDocIndex(mCursorPos, false);
 	S32 line_start = getLineStart(line);
 	S32 space_count = 0;
 	S32 i;
diff --git a/indra/newview/skins/default/xui/en/floater_test_text_editor.xml b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml
index b730f0e511..548e24efba 100644
--- a/indra/newview/skins/default/xui/en/floater_test_text_editor.xml
+++ b/indra/newview/skins/default/xui/en/floater_test_text_editor.xml
@@ -14,6 +14,7 @@
    name="test_text_editor"
    tool_tip="text editor"
    top="25"
+   word_wrap="true" 
    width="200">
     Text Editor
   </text_editor>
-- 
cgit v1.2.3


From 39ef9e9dd6cbeb26b7e223888a17380a272370bb Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 1 Apr 2010 14:56:53 -0700
Subject: EXT-6492 - button halign=center doesn't take into account left and
 right pad

---
 indra/llui/llbutton.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra')

diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 1d4dc35cee..33c6a8b6ac 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -824,7 +824,7 @@ void LLButton::draw()
 			x = text_right;
 			break;
 		case LLFontGL::HCENTER:
-			x = getRect().getWidth() / 2;
+			x = text_left + (text_width / 2);
 			break;
 		case LLFontGL::LEFT:
 		default:
-- 
cgit v1.2.3


From dcc5e0a4faaf7d877a736ade4a334d1936e71bef Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Thu, 1 Apr 2010 15:48:56 -0700
Subject: EXT-3531 - Ctrl-p doesn't work reliably on login moved
 gEditMenuHandler handling to LLEditMenuHandler destructor

---
 indra/llui/lleditmenuhandler.cpp | 7 +++++++
 indra/llui/lleditmenuhandler.h   | 2 +-
 indra/llui/lllineeditor.cpp      | 6 +-----
 indra/llui/llscrolllistctrl.cpp  | 5 -----
 indra/llui/lltexteditor.cpp      | 8 +-------
 indra/newview/llfolderview.cpp   | 5 -----
 indra/newview/llviewermedia.cpp  | 5 -----
 7 files changed, 10 insertions(+), 28 deletions(-)

(limited to 'indra')

diff --git a/indra/llui/lleditmenuhandler.cpp b/indra/llui/lleditmenuhandler.cpp
index 821afae8fd..9d8af39a7a 100644
--- a/indra/llui/lleditmenuhandler.cpp
+++ b/indra/llui/lleditmenuhandler.cpp
@@ -37,3 +37,10 @@
 /* static */
 LLEditMenuHandler* LLEditMenuHandler::gEditMenuHandler = NULL;
 
+LLEditMenuHandler::~LLEditMenuHandler()
+{
+	if (gEditMenuHandler == this)
+	{
+		gEditMenuHandler = NULL;
+	}
+}
\ No newline at end of file
diff --git a/indra/llui/lleditmenuhandler.h b/indra/llui/lleditmenuhandler.h
index 1de9c56afb..d72283cd99 100644
--- a/indra/llui/lleditmenuhandler.h
+++ b/indra/llui/lleditmenuhandler.h
@@ -38,7 +38,7 @@ class LLEditMenuHandler
 {
 public:
 	// this is needed even though this is just an interface class.
-	virtual ~LLEditMenuHandler() {};
+	virtual ~LLEditMenuHandler();
 	
 	virtual void	undo() {};
 	virtual BOOL	canUndo() const { return FALSE; }
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 483a394bbd..2a17ddb9e7 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -192,12 +192,8 @@ LLLineEditor::~LLLineEditor()
 {
 	mCommitOnFocusLost = FALSE;
 
+	// calls onCommit() while LLLineEditor still valid
 	gFocusMgr.releaseFocusIfNeeded( this );
-
-	if( gEditMenuHandler == this )
-	{
-		gEditMenuHandler = NULL;
-	}
 }
 
 
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index bf0866a655..db0f2bd6e2 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -324,11 +324,6 @@ LLScrollListCtrl::~LLScrollListCtrl()
 	delete mSortCallback;
 
 	std::for_each(mItemList.begin(), mItemList.end(), DeletePointer());
-
-	if( gEditMenuHandler == this )
-	{
-		gEditMenuHandler = NULL;
-	}
 }
 
 
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 94c7ebec2a..c9751c8139 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -304,13 +304,7 @@ void LLTextEditor::initFromParams( const LLTextEditor::Params& p)
 LLTextEditor::~LLTextEditor()
 {
 	gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() while LLTextEditor still valid
-
-	// Route menu back to the default
-	if( gEditMenuHandler == this )
-	{
-		gEditMenuHandler = NULL;
-	}
-
+	
 	// Scrollbar is deleted by LLView
 	std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer());
 
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 43743ec37a..83eb9579b2 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -276,11 +276,6 @@ LLFolderView::~LLFolderView( void )
 	mRenamer = NULL;
 	mStatusTextBox = NULL;
 
-	if( gEditMenuHandler == this )
-	{
-		gEditMenuHandler = NULL;
-	}
-
 	mAutoOpenItems.removeAllNodes();
 	gIdleCallbacks.deleteFunction(idle, this);
 
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index d3eed40f25..e0cbddafae 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1473,11 +1473,6 @@ LLViewerMediaImpl::LLViewerMediaImpl(	  const LLUUID& texture_id,
 //////////////////////////////////////////////////////////////////////////////////////////
 LLViewerMediaImpl::~LLViewerMediaImpl()
 {
-	if( gEditMenuHandler == this )
-	{
-		gEditMenuHandler = NULL;
-	}
-	
 	destroyMediaSource();
 	
 	LLViewerMediaTexture::removeMediaImplFromTexture(mTextureId) ;
-- 
cgit v1.2.3