summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelenvironment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r--indra/newview/llpanelenvironment.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index 7dd9f6e86e..be61c44b7c 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -287,8 +287,8 @@ void LLPanelEnvironmentInfo::refresh()
F32Hours daylength(mCurrentEnvironment->mDayLength);
F32Hours dayoffset(mCurrentEnvironment->mDayOffset);
- while (dayoffset.value() >= daylength.value())
- dayoffset -= daylength;
+ if (dayoffset.value() > 12.0f)
+ dayoffset -= F32Hours(24.0);
mSliderDayLength->setValue(daylength.value());
mSliderDayOffset->setValue(dayoffset.value());
@@ -717,11 +717,6 @@ void LLPanelEnvironmentInfo::onSldDayLengthChanged(F32 value)
F32Hours daylength(value);
mCurrentEnvironment->mDayLength = daylength;
- F32 offset = (F32)mSliderDayOffset->getValue().asReal();
- if (offset <= 0.0f)
- {
- onSldDayOffsetChanged(offset);
- }
setDirtyFlag(DIRTY_FLAG_DAYLENGTH);
udpateApparentTimeOfDay();
@@ -734,9 +729,8 @@ void LLPanelEnvironmentInfo::onSldDayOffsetChanged(F32 value)
{
F32Hours dayoffset(value);
- // server only allows positive values
- while (dayoffset.value() <= 0.0f)
- dayoffset += mCurrentEnvironment->mDayLength;
+ if (dayoffset.value() <= 0.0f)
+ dayoffset += F32Hours(24.0);
mCurrentEnvironment->mDayOffset = dayoffset;
setDirtyFlag(DIRTY_FLAG_DAYOFFSET);
@@ -928,7 +922,7 @@ void LLPanelEnvironmentInfo::udpateApparentTimeOfDay()
{
static const F32 SECONDSINDAY(24.0 * 60.0 * 60.0);
- if ((!mCurrentEnvironment) || (mCurrentEnvironment->mDayLength.value() < 1.0))
+ if ((!mCurrentEnvironment) || (mCurrentEnvironment->mDayLength.value() < 1.0) || (mCurrentEnvironment->mDayOffset.value() < 1.0))
{
mLabelApparentTime->setVisible(false);
return;