Commit 2edc6dbb authored by Adam Barth's avatar Adam Barth

Add AnimatedSizeValue

parent 4f96083e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:ui' show Color, Rect; import 'dart:ui' show Color, Size, Rect;
import 'curves.dart'; import 'curves.dart';
...@@ -104,6 +104,17 @@ class AnimatedColorValue extends AnimatedValue<Color> { ...@@ -104,6 +104,17 @@ class AnimatedColorValue extends AnimatedValue<Color> {
Color lerp(double t) => Color.lerp(begin, end, t); Color lerp(double t) => Color.lerp(begin, end, t);
} }
/// An animated variable containing a rectangle
///
/// This class specializes the interpolation of AnimatedValue<Rect> to be
/// appropriate for rectangles.
class AnimatedSizeValue extends AnimatedValue<Size> {
AnimatedSizeValue(Size begin, { Size end, Curve curve, Curve reverseCurve })
: super(begin, end: end, curve: curve, reverseCurve: reverseCurve);
Size lerp(double t) => Size.lerp(begin, end, t);
}
/// An animated variable containing a rectangle /// An animated variable containing a rectangle
/// ///
/// This class specializes the interpolation of AnimatedValue<Rect> to be /// This class specializes the interpolation of AnimatedValue<Rect> to be
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment