From d748dbce457dabf6bc46eb22c5c5315f50af159c Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 31 Jul 2018 17:35:42 +0100 Subject: MAINT-8909 Loosen precision when checking rotation and other false negatives when comparing faces to see if they can be considered planar aligned. This was causing fields to be marked tentative (grayed display) incorrectly. --- indra/newview/llselectmgr.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'indra/newview/llselectmgr.h') diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 25ee8619d7..cbe9200c4e 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -124,6 +124,11 @@ template struct LLSelectedTEGetFunctor virtual T get(LLViewerObject* object, S32 te) = 0; }; +template struct LLCheckIdenticalFunctor +{ + static bool same(const T& a, const T& b, const T& tolerance); +}; + typedef enum e_send_type { SEND_ONLY_ROOTS, @@ -313,7 +318,7 @@ public: LLViewerObject* getPrimaryObject() { return mPrimaryObject; } // iterate through texture entries - template bool getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res); + template bool getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res, bool has_tolerance = false, T tolerance = T()); template bool isMultipleTEValue(LLSelectedTEGetFunctor* func, const T& ignore_value); S32 getNumNodes(); @@ -856,7 +861,7 @@ void dialog_refresh_all(); //----------------------------------------------------------------------------- // getSelectedTEValue //----------------------------------------------------------------------------- -template bool LLObjectSelection::getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res) +template bool LLObjectSelection::getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res, bool has_tolerance, T tolerance) { bool have_first = false; bool have_selected = false; @@ -892,7 +897,14 @@ template bool LLObjectSelection::getSelectedTEValue(LLSelectedTEGet { if ( value != selected_value ) { - identical = false; + if (!has_tolerance) + { + identical = false; + } + else if (!LLCheckIdenticalFunctor::same(value, selected_value, tolerance)) + { + identical = false; + } } if (te == selected_te) { -- cgit v1.2.3