From 160d59d5e030ccc4c8ec237b07fe7a351dd4ba2e Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sat, 10 Jul 2021 01:10:01 -0400 Subject: [PATCH] Expose face transparency as 0-1 decimal instead of percent --- indra/newview/llpanelface.cpp | 6 +++--- .../skins/default/xui/en/panel_tools_texture.xml | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 5559d72d2b4..982f0debcaa 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -261,7 +261,7 @@ BOOL LLPanelFace::postBuild() if(mCtrlColorTransp) { mCtrlColorTransp->setCommitCallback(boost::bind(&LLPanelFace::onCommitAlpha, this, _2)); - mCtrlColorTransp->setPrecision(0); + mCtrlColorTransp->setPrecision(3); mCtrlColorTransp->setFollowsTop(); mCtrlColorTransp->setFollowsLeft(); } @@ -418,7 +418,7 @@ void LLPanelFace::sendAlpha() { LLSpinCtrl* mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans"); if(!mCtrlColorTransp)return; - F32 alpha = (100.f - mCtrlColorTransp->get()) / 100.f; + F32 alpha = mCtrlColorTransp->get(); LLSelectMgr::getInstance()->selectionSetAlphaOnly( alpha ); } @@ -879,7 +879,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) // Color transparency getChildView("color trans")->setEnabled(editable); - F32 transparency = (1.f - color.mV[VALPHA]) * 100.f; + F32 transparency = color.mV[VALPHA]; getChild<LLUICtrl>("ColorTrans")->setValue(editable ? transparency : 0); getChildView("ColorTrans")->setEnabled(editable); diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index 90f32ae4526..fca5e1c8d7f 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -48,17 +48,17 @@ text_readonly_color="LabelDisabledColor" top="6" width="110"> - Transparency % + Transparency </text> <spinner - decimal_digits="0" + decimal_digits="3" follows="left|top" height="19" - increment="2" + increment="0.01" initial_value="0" layout="topleft" left_delta="0" - max_val="100" + max_val="1" name="ColorTrans" top_pad="4" width="80" /> @@ -76,7 +76,7 @@ Glow </text> <spinner - decimal_digits="2" + decimal_digits="3" follows="left|top" height="19" initial_value="0" -- GitLab