Example #1
0
        public IReadOnlyList <float> GetIrregularSnapPoints(Orientation orientation, Primitives.SnapPointsAlignment alignment)
        {
            if (orientation == Orientation && _snapPoints != null)
            {
                switch (alignment)
                {
                case SnapPointsAlignment.Far:
                    return(_snapPoints);

                case SnapPointsAlignment.Center:
                {
                    float previous = 0;
                    var   result   = new List <float>(_snapPoints.Select(sp => (previous + sp) / 2));

                    return(result);
                }

                case SnapPointsAlignment.Near:
                {
                    var result = new List <float>(_snapPoints.Count);
                    result.Add(0f);
                    for (var i = 1; i < _snapPoints.Count; i++)
                    {
                        result.Add(_snapPoints[i - 1]);
                    }
                    return(result);
                }
                }
            }
            return(new float[0]);
        }
Example #2
0
 public float GetRegularSnapPoints(Orientation orientation, Primitives.SnapPointsAlignment alignment, out float offset)
 {
     throw new InvalidOperationException();
 }