mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
1e8fa40450
commit
a03757e443
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user