Fix up sun glow/size bindings in edit panel.

master
Graham Linden 2018-07-04 01:33:22 +01:00
parent a682d91ea1
commit 9bacdc9886
1 changed files with 5 additions and 10 deletions

View File

@ -330,13 +330,9 @@ void LLPanelSettingsSkySunMoonTab::refresh()
getChild<LLColorSwatchCtrl>(FIELD_SKY_SUN_MOON_COLOR)->set(mSkySettings->getSunlightColor() / SLIDER_SCALE_SUN_AMBIENT);
LLColor3 glow(mSkySettings->getGlow());
glow.mV[0] = 2 - (glow.mV[0] / SLIDER_SCALE_GLOW_R);
glow.mV[2] /= SLIDER_SCALE_GLOW_B;
getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[0]);
getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setValue(glow.mV[2]);
getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setValue(2.0 - (glow.mV[0] / SLIDER_SCALE_GLOW_R));
getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[2] / SLIDER_SCALE_GLOW_B);
getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mSkySettings->getStarBrightness());
getChild<LLJoystickQuaternion>(FIELD_SKY_SUN_ROTATION)->setRotation(mSkySettings->getSunRotation());
getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setValue(mSkySettings->getSunTextureId());
@ -356,10 +352,9 @@ void LLPanelSettingsSkySunMoonTab::onSunMoonColorChanged()
void LLPanelSettingsSkySunMoonTab::onGlowChanged()
{
LLColor3 glow(getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal(), 0.0f,
getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal());
LLColor3 glow(getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal(), 0.0f, getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal());
glow.mV[0] = (2 - glow.mV[0]) * SLIDER_SCALE_GLOW_R;
glow.mV[0] = (2.0f - glow.mV[0]) * SLIDER_SCALE_GLOW_R;
glow.mV[2] *= SLIDER_SCALE_GLOW_B;
mSkySettings->setGlow(glow);