summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2019-03-27 17:06:45 +0200
committermaxim_productengine <mnikolenko@productengine.com>2019-03-27 17:06:45 +0200
commitfdcf1b8783eb19ca2c96267c46e456be8e84fdb8 (patch)
tree5a4bd45aa2a42841e3206e4524b78403c9450a0d
parent9dee4149ae6f33e2f82b8986b041df311f0cbe88 (diff)
SL-10818 FIXED [EEP] Wrong selection when keyframes are close together
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index feb734f64e..403d0ff9d8 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -859,11 +859,15 @@ LLSettingsDay::CycleTrack_t::value_type LLSettingsDay::getSettingsNearKeyframe(c
if (startframe < 0.0f)
startframe = 1.0f + startframe;
- CycleTrack_t::iterator it = get_wrapping_atafter(const_cast<CycleTrack_t &>(mDayTracks[track]), startframe);
+ LLSettingsDay::CycleTrack_t collection = const_cast<CycleTrack_t &>(mDayTracks[track]);
+ CycleTrack_t::iterator it = get_wrapping_atafter(collection, startframe);
F32 dist = get_wrapping_distance(startframe, (*it).first);
- if (dist <= (fudge * 2.0f))
+ CycleTrack_t::iterator next_it = std::next(it);
+ if ((dist <= DEFAULT_MULTISLIDER_INCREMENT) && next_it != collection.end())
+ return (*next_it);
+ else if (dist <= (fudge * 2.0f))
return (*it);
return CycleTrack_t::value_type(TrackPosition(INVALID_TRACKPOS), LLSettingsBase::ptr_t());