Operators needed to lerp a FractionalOffset.

Without this, you can't use AnimatedValue<FractionalOffset>, because its
lerp() function uses the operators.
This commit is contained in:
Hixie 2015-11-25 17:15:00 -08:00
parent 1e8fa40450
commit a03757e443

View File

@ -1110,6 +1110,15 @@ class FractionalOffset {
const FractionalOffset(this.x, this.y);
final double x;
final double y;
FractionalOffset operator -(FractionalOffset other) {
return new FractionalOffset(x - other.x, y - other.y);
}
FractionalOffset operator +(FractionalOffset other) {
return new FractionalOffset(x + other.x, y + other.y);
}
FractionalOffset operator *(double other) {
return new FractionalOffset(x * other, y * other);
}
bool operator ==(dynamic other) {
if (other is! FractionalOffset)
return false;