summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-02-07 08:40:59 -0800
committerGraham Linden <graham@lindenlab.com>2019-02-07 08:40:59 -0800
commit8418e45ac63cfd2702aa9985c2178469549fb36d (patch)
treea51d9e3f83724f5a3416daba8323a2056480b73d /indra/newview
parent5bdc941b431ffd7757897d7982ebcfbf01119f09 (diff)
parent95e9b9d2d284c50b1f31b86d012b22a06ebd5e34 (diff)
Merge
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llenvironment.cpp28
-rw-r--r--indra/newview/llpanelenvironment.cpp2
-rw-r--r--indra/newview/llsettingspicker.cpp10
3 files changed, 33 insertions, 7 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index bf8cf4b552..fa583bdc9c 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -170,6 +170,20 @@ namespace
return llclamp(position, 0.0f, 1.0f);
}
+ inline LLSettingsBase::BlendFactor convert_time_to_blend_factor(const LLSettingsBase::Seconds& time, const LLSettingsBase::Seconds& len, LLSettingsDay::CycleTrack_t &track)
+ {
+ LLSettingsBase::TrackPosition position = convert_time_to_position(time, len);
+ LLSettingsDay::TrackBound_t bounds(get_bounding_entries(track, position));
+
+ LLSettingsBase::TrackPosition spanlength(get_wrapping_distance((*bounds.first).first, (*bounds.second).first));
+ if (position < (*bounds.first).first)
+ position += 1.0;
+
+ LLSettingsBase::TrackPosition start = position - (*bounds.first).first;
+
+ return static_cast<LLSettingsBase::BlendFactor>(start / spanlength);
+ }
+
//---------------------------------------------------------------------
class LLTrackBlenderLoopingTime : public LLSettingsBlenderTimeDelta
{
@@ -186,12 +200,14 @@ namespace
// must happen prior to getBoundingEntries call...
mTrackNo = selectTrackNumber(trackno);
- LLSettingsDay::TrackBound_t initial = getBoundingEntries(getAdjustedNow());
+ LLSettingsBase::Seconds now(getAdjustedNow());
+ LLSettingsDay::TrackBound_t initial = getBoundingEntries(now);
mInitial = (*initial.first).second;
mFinal = (*initial.second).second;
mBlendSpan = getSpanTime(initial);
+ initializeTarget(now);
setOnFinished([this](const LLSettingsBlender::ptr_t &){ onFinishedSpan(); });
}
@@ -248,6 +264,16 @@ namespace
return bounds;
}
+ void initializeTarget(LLSettingsBase::Seconds time)
+ {
+ LLSettingsBase::BlendFactor blendf(convert_time_to_blend_factor(time, mCycleLength, mDay->getCycleTrack(mTrackNo)));
+
+ blendf = llclamp(blendf, 0.0, 0.999);
+ setTimeSpent(LLSettingsBase::Seconds(blendf * mBlendSpan));
+
+ setBlendFactor(blendf);
+ }
+
LLSettingsBase::Seconds getAdjustedNow() const
{
LLSettingsBase::Seconds now(LLDate::now().secondsSinceEpoch());
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index d20cc096de..2cfd0c8fc9 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -262,7 +262,7 @@ void LLPanelEnvironmentInfo::refresh()
updateEditFloater(mCurrentEnvironment, canEdit());
- LLEnvironment::altitude_list_t altitudes = LLEnvironment::instance().getRegionAltitudes();
+ LLEnvironment::altitude_list_t altitudes = mCurrentEnvironment->mAltitudes;
if (altitudes.size() > 0)
{
diff --git a/indra/newview/llsettingspicker.cpp b/indra/newview/llsettingspicker.cpp
index e2d6d43ae3..fcc615db6e 100644
--- a/indra/newview/llsettingspicker.cpp
+++ b/indra/newview/llsettingspicker.cpp
@@ -356,9 +356,9 @@ BOOL LLFloaterSettingsPicker::handleDoubleClick(S32 x, S32 y, MASK mask)
S32 inventory_y = y - mInventoryPanel->getRect().mBottom;
if (mInventoryPanel->parentPointInView(inventory_x, inventory_y))
{
- // make sure item (not folder) is selected
+ // make sure item is selected and visible
LLFolderViewItem* item_viewp = mInventoryPanel->getItemByID(mSettingItemID);
- if (item_viewp && item_viewp->getIsCurSelection())
+ if (item_viewp && item_viewp->getIsCurSelection() && item_viewp->getVisible())
{
LLRect target_rect;
item_viewp->localRectToOtherView(item_viewp->getLocalRect(), &target_rect, this);
@@ -373,10 +373,10 @@ BOOL LLFloaterSettingsPicker::handleDoubleClick(S32 x, S32 y, MASK mask)
(*mCommitSignal)(this, res);
}
closeFloater();
+ // hit inside panel on selected item, double click should do nothing
+ result = TRUE;
}
}
- // hit inside panel on free place or (de)unselected item, double click should do nothing
- result = TRUE;
}
}
@@ -392,7 +392,7 @@ BOOL LLFloaterSettingsPicker::handleKeyHere(KEY key, MASK mask)
if ((key == KEY_RETURN) && (mask == MASK_NONE))
{
LLFolderViewItem* item_viewp = mInventoryPanel->getItemByID(mSettingItemID);
- if (item_viewp && item_viewp->getIsCurSelection())
+ if (item_viewp && item_viewp->getIsCurSelection() && item_viewp->getVisible())
{
// Quick-apply
if (mCommitSignal)