summaryrefslogtreecommitdiff
path: root/indra/newview/llmaniptranslate.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-12-10 17:18:24 -0800
committerJames Cook <james@lindenlab.com>2009-12-10 17:18:24 -0800
commitb26694f2ab4d88fb8a0e4b1f0e8733f111af4522 (patch)
tree7b3220781c67e2e060d67411fb891cab7a0895b0 /indra/newview/llmaniptranslate.cpp
parente2fa9eb03a054fbb3fd20e0b105ec0a1174e2113 (diff)
Again fix Mac builsd
Diffstat (limited to 'indra/newview/llmaniptranslate.cpp')
-rw-r--r--indra/newview/llmaniptranslate.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 55d60ad52a..5f30ab4e01 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -101,6 +101,16 @@ const U32 ARROW_TO_AXIS[4] =
VZ
};
+// Sort manipulator handles by their screen-space projection
+struct ClosestToCamera
+{
+ bool operator()(const LLManipTranslate::ManipulatorHandle& a,
+ const LLManipTranslate::ManipulatorHandle& b) const
+ {
+ return a.mEndPosition.mV[VZ] < b.mEndPosition.mV[VZ];
+ }
+};
+
LLManipTranslate::LLManipTranslate( LLToolComposite* composite )
: LLManip( std::string("Move"), composite ),
mLastHoverMouseX(-1),
@@ -967,16 +977,10 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
LLVector2 mousePos((F32)x - half_width, (F32)y - half_height);
LLVector2 mouse_delta;
- struct ClosestToCamera {
- bool operator()(const ManipulatorHandle& a, const ManipulatorHandle& b) const
- {
- return a.mEndPosition.mV[VZ] < b.mEndPosition.mV[VZ];
- }
- } closest_to_camera;
// Keep order consistent with insertion via stable_sort
std::stable_sort( projected_manipulators.begin(),
projected_manipulators.end(),
- closest_to_camera );
+ ClosestToCamera() );
std::vector<ManipulatorHandle>::iterator it = projected_manipulators.begin();
for ( ; it != projected_manipulators.end(); ++it)