private Drawable transformFloatTo(float startValue, float newValue, double duration, EasingTypes easing, TransformFloat transform) { Type type = transform.GetType(); if (transformationDelay == 0) { updateTransformsOfType(type); Transforms.RemoveAll(t => t.GetType() == type); if (startValue == newValue) { return(this); } } else { startValue = (Transforms.FindLast(t => t.GetType() == type) as TransformFloat)?.EndValue ?? startValue; } double startTime = Time + transformationDelay; transform.StartTime = startTime; transform.EndTime = startTime + duration; transform.StartValue = startValue; transform.EndValue = newValue; transform.Easing = easing; if (duration == 0) { transform.Apply(this); } else { Transforms.Add(transform); } return(this); }
protected void TransformFloatTo(float startValue, float newValue, double duration, EasingTypes easing, TransformFloat transform) { Type type = transform.GetType(); if (transformationDelay == 0) { Transforms.RemoveAll(t => t.GetType() == type); if (startValue == newValue) { return; } } else { startValue = (Transforms.FindLast(t => t.GetType() == type) as TransformFloat)?.EndValue ?? startValue; } double startTime = Clock != null ? (Time.Current + transformationDelay) : 0; transform.StartTime = startTime; transform.EndTime = startTime + duration; transform.StartValue = startValue; transform.EndValue = newValue; transform.Easing = easing; if (Clock == null) { transform.UpdateTime(new FrameTimeInfo { Current = transform.EndTime }); transform.Apply(this); } else if (duration == 0 && transformationDelay == 0) { transform.UpdateTime(Time); transform.Apply(this); } else { Transforms.Add(transform); } }