summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-07-31 17:35:42 +0100
committerGraham Linden <graham@lindenlab.com>2018-07-31 17:35:42 +0100
commitd748dbce457dabf6bc46eb22c5c5315f50af159c (patch)
tree804a416cf30511e82f12171370bd4da46a64213b /indra/newview/llpanelface.cpp
parent60d256e80f019e77afef941bc02eb65be6f9bc6d (diff)
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.
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r--indra/newview/llpanelface.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index d2d75784e8..b71e98b102 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -605,12 +605,19 @@ struct LLPanelFaceGetIsAlignedTEFunctor : public LLSelectedTEFunctor
tep->getOffset(&st_offset.mV[VX], &st_offset.mV[VY]);
tep->getScale(&st_scale.mV[VX], &st_scale.mV[VY]);
F32 st_rot = tep->getRotation();
+
+ bool eq_offset_x = is_approx_equal_fraction(st_offset.mV[VX], aligned_st_offset.mV[VX], 12);
+ bool eq_offset_y = is_approx_equal_fraction(st_offset.mV[VY], aligned_st_offset.mV[VY], 12);
+ bool eq_scale_x = is_approx_equal_fraction(st_scale.mV[VX], aligned_st_scale.mV[VX], 12);
+ bool eq_scale_y = is_approx_equal_fraction(st_scale.mV[VY], aligned_st_scale.mV[VY], 12);
+ bool eq_rot = is_approx_equal_fraction(st_rot, aligned_st_rot, 6);
+
// needs a fuzzy comparison, because of fp errors
- if (is_approx_equal_fraction(st_offset.mV[VX], aligned_st_offset.mV[VX], 12) &&
- is_approx_equal_fraction(st_offset.mV[VY], aligned_st_offset.mV[VY], 12) &&
- is_approx_equal_fraction(st_scale.mV[VX], aligned_st_scale.mV[VX], 12) &&
- is_approx_equal_fraction(st_scale.mV[VY], aligned_st_scale.mV[VY], 12) &&
- is_approx_equal_fraction(st_rot, aligned_st_rot, 14))
+ if (eq_offset_x &&
+ eq_offset_y &&
+ eq_scale_x &&
+ eq_scale_y &&
+ eq_rot)
{
return true;
}
@@ -973,9 +980,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
F32 spec_scale_s = 1.f;
F32 norm_scale_s = 1.f;
- LLSelectedTE::getScaleS( diff_scale_s, identical_diff_scale_s);
- LLSelectedTEMaterial::getSpecularRepeatX( spec_scale_s, identical_spec_scale_s);
- LLSelectedTEMaterial::getNormalRepeatX( norm_scale_s, identical_norm_scale_s);
+ LLSelectedTE::getScaleS(diff_scale_s, identical_diff_scale_s);
+ LLSelectedTEMaterial::getSpecularRepeatX(spec_scale_s, identical_spec_scale_s);
+ LLSelectedTEMaterial::getNormalRepeatX(norm_scale_s, identical_norm_scale_s);
diff_scale_s = editable ? diff_scale_s : 1.0f;
diff_scale_s *= identical_planar_texgen ? 2.0f : 1.0f;
@@ -2438,7 +2445,7 @@ void LLPanelFace::LLSelectedTE::getFace(LLFace*& face_to_return, bool& identical
return (object->mDrawable) ? object->mDrawable->getFace(te): NULL;
}
} get_te_face_func;
- identical_face = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_te_face_func, face_to_return);
+ identical_face = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_te_face_func, face_to_return, false, (LLFace*)nullptr);
}
void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return, bool& identical_face)