public SvgPath (Path path, Paint paint)
			{
				this.path = path;
				this.paint = paint;
				measure = new PathMeasure (path, false);
				length = measure.Length;
				region.SetPath (path, maxClip);
				bounds = region.Bounds;
			}
Exemple #2
0
        protected internal override void ComputeRender(float renderProgress)
        {
            if (renderProgress <= START_TRIM_DURATION_OFFSET)
            {
                float startTrimProgress = (renderProgress) / START_TRIM_DURATION_OFFSET;
                mEndTrim  = -MATERIAL_INTERPOLATOR.GetInterpolation(startTrimProgress);
                mRotation = START_TRIM_INIT_ROTATION + START_TRIM_MAX_ROTATION * MATERIAL_INTERPOLATOR.GetInterpolation(startTrimProgress);
            }

            if (renderProgress <= WAVE_DURATION_OFFSET && renderProgress > START_TRIM_DURATION_OFFSET)
            {
                float waveProgress = (renderProgress - START_TRIM_DURATION_OFFSET) / (WAVE_DURATION_OFFSET - START_TRIM_DURATION_OFFSET);
                mWaveProgress = ACCELERATE_INTERPOLATOR.GetInterpolation(waveProgress);
            }

            if (renderProgress <= BALL_SKIP_DURATION_OFFSET && renderProgress > WAVE_DURATION_OFFSET)
            {
                if (mPathMeasure == null)
                {
                    mPathMeasure = new PathMeasure(CreateSkipBallPath(), false);
                }

                float ballSkipProgress = (renderProgress - WAVE_DURATION_OFFSET) / (BALL_SKIP_DURATION_OFFSET - WAVE_DURATION_OFFSET);
                mPathMeasure.GetPosTan(ballSkipProgress * mPathMeasure.Length, mCurrentPosition, null);

                mWaveProgress = 1.0f;
            }

            if (renderProgress <= BALL_SCALE_DURATION_OFFSET && renderProgress > BALL_SKIP_DURATION_OFFSET)
            {
                float ballScaleProgress = (renderProgress - BALL_SKIP_DURATION_OFFSET) / (BALL_SCALE_DURATION_OFFSET - BALL_SKIP_DURATION_OFFSET);
                if (ballScaleProgress < 0.5f)
                {
                    mScale = 1.0f + DECELERATE_INTERPOLATOR.GetInterpolation(ballScaleProgress * 2.0f);
                }
                else
                {
                    mScale = 2.0f - ACCELERATE_INTERPOLATOR.GetInterpolation((ballScaleProgress - 0.5f) * 2.0f) * 2.0f;
                }
            }

            if (renderProgress >= BALL_SCALE_DURATION_OFFSET)
            {
                float endTrimProgress = (renderProgress - BALL_SKIP_DURATION_OFFSET) / (END_TRIM_DURATION_OFFSET - BALL_SKIP_DURATION_OFFSET);
                mEndTrim  = -1 + MATERIAL_INTERPOLATOR.GetInterpolation(endTrimProgress);
                mRotation = END_TRIM_INIT_ROTATION + END_TRIM_MAX_ROTATION * MATERIAL_INTERPOLATOR.GetInterpolation(endTrimProgress);

                mScale       = 1.0f;
                mPathMeasure = null;
            }
        }
			public JoinedPath(Path pathFirst, Path pathSecond) {
				measureFirst = new PathMeasure(pathFirst, false);
				measureSecond = new PathMeasure(pathSecond, false);
				lengthFirst = measureFirst.Length;
				lengthSecond = measureSecond.Length;
			}