private void SetValueCoercedToGroup(IScatterSymbol value) { if (_isStepEnabled) { var idx = Math.Max(0, _listOfValues.IndexOf(value)); _value = _listOfValues[idx]; } else { _value = value; } }
public int Step(int step) { if (0 == step) { return(0); // nothing changed } var list = _listOfValues; var listcount = list.Count; if (listcount == 0) { return(0); } int currentIdx = Math.Max(0, _listOfValues.IndexOf(_value)); var valueIndex = Calc.BasicFunctions.PMod(currentIdx + step, _listOfValues.Count); int wraps = Calc.BasicFunctions.NumberOfWraps(_listOfValues.Count, currentIdx, step); _value = _listOfValues[valueIndex]; return(wraps); }