Exemple #1
0
        public override Vector2?GetValue(IKeyframe <Vector2?> keyframe, float keyframeProgress)
        {
            var pathKeyframe = (PathKeyframe)keyframe;
            var path         = pathKeyframe.Path;

            if (path == null || path.Contours.Count == 0)
            {
                return(keyframe.StartValue);
            }

            if (_pathMeasureKeyframe != pathKeyframe)
            {
                _pathMeasure         = new PathMeasure(path);
                _pathMeasureKeyframe = pathKeyframe;
            }

            return(_pathMeasure.GetPosTan(keyframeProgress * _pathMeasure.Length));
        }
        public override PointF GetValue(IKeyframe <PointF> keyframe, float keyframeProgress)
        {
            var pathKeyframe = (PathKeyframe)keyframe;
            var path         = pathKeyframe.Path;

            if (path == null || path.Contours.Count == 0)
            {
                return(keyframe.StartValue);
            }

            if (_pathMeasureKeyframe != pathKeyframe)
            {
                _pathMeasure         = new PathMeasure(path);
                _pathMeasureKeyframe = pathKeyframe;
            }

            _pathMeasure.GetPosTan(keyframeProgress * _pathMeasure.Length, ref _pos);
            _point.Set(_pos[0], _pos[1]);
            return(_point);
        }