diff options
author | Monroe Linden <monroe@lindenlab.com> | 2009-12-10 15:17:32 -0800 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2009-12-10 15:17:32 -0800 |
commit | 8eb2f3bd0fb0860105b71c45dc473f684b03438e (patch) | |
tree | 9b424fd5918c37bae0a7c0e3444dbadaaf8a2073 /indra | |
parent | a97479f41bae05ff08b3598a9497be9be3ee371d (diff) |
Fix for the last case in DEV-43052.
In proximity_comparitor(), if the impls have exactly the same distance, return the result of comparing the impl pointers. This will give them a completely arbitrary ordering, but it will be stable...
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 0aae1a093d..d3f364e6fe 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -630,7 +630,22 @@ bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLView static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2) { - return (i1->getProximityDistance() < i2->getProximityDistance()); + if(i1->getProximityDistance() < i2->getProximityDistance()) + { + return true; + } + else if(i1->getProximityDistance() > i2->getProximityDistance()) + { + return false; + } + else + { + // Both objects have the same distance. This most likely means they're two faces of the same object. + // They may also be faces on different objects with exactly the same distance (like HUD objects). + // We don't actually care what the sort order is for this case, as long as it's stable and doesn't change when you enable/disable media. + // Comparing the impl pointers gives a completely arbitrary ordering, but it will be stable. + return (i1 < i2); + } } ////////////////////////////////////////////////////////////////////////////////////////// |