Beispiel #1
0
        /// <summary>
        /// Gets the distance position of the next entity after a given point.
        /// </summary>
        /// <param name="point">The point.</param>
        /// <returns>The distance position.</returns>
        public double GetNextScrollValue(double point)
        {
            int index = IndexOfCumulatedDistance(point);

            if (index >= Count)
            {
                return(double.NaN);
            }

            double nestedStart = GetCumulatedDistanceAt(index);
            double delta       = point - nestedStart;
            IDistanceCounterCollection nestedDcc = GetNestedDistances(index);

            if (nestedDcc != null)
            {
                double r = nestedDcc.GetNextScrollValue(delta);
                if (!double.IsNaN(r) && r >= 0 && r < nestedDcc.TotalDistance)
                {
                    return(nestedStart + r);
                }
            }

            index = GetNextVisibleIndex(index);
            if (index >= 0 && index < Count)
            {
                return(GetCumulatedDistanceAt(index));
            }

            return(double.NaN);
        }
Beispiel #2
0
        /// <summary>
        /// Gets the distance position of the next entity after a given point.
        /// </summary>
        /// <param name="point">The point.</param>
        /// <returns>The distance position.</returns>
        public double GetNextScrollValue(double point)
        {
            double offset = trackDCC.GetCumulatedDistanceAt(start);
            double d      = trackDCC.GetNextScrollValue(point + offset);

            if (double.IsNaN(d) || d < offset || d - offset > TotalDistance)
            {
                return(double.NaN);
            }
            return(d - offset);
        }