-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Added support for lerpDuration() #64668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for lerpDuration() #64668
Conversation
|
@cbracken I moved the @Hixie I placed WRT to the tests, are there specific edge-case values that you believe are important here? I know you mentioned large numbers, infinity, and NaN WRT to |
|
This all looks great. Durations can't be NaN or Infinity so no worries there. Supporting non-null only seems fine, it's not clear what a null Duration would mean. basic_types.dart seems fine. |
Hixie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cbracken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return Duration( | ||
| microseconds: (a.inMicroseconds + (b.inMicroseconds - a.inMicroseconds) * t).round(), | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and below: Very minor nit, source files should end with a linefeed. That said, that's probably more pedantic than anything -- I'm 99% certain that the entire Dart toolchain consistently handles this just fine without it. But not a bad idea anyway.


Adds the ability to linearly interpolate Durations.