• Greg Price's avatar
    Fix buggy formula for critically-damped springs (#120488) · 97938859
    Greg Price authored
    Fixes #109675.
    
    This formula would produce an initial velocity quite different
    from the one specified as an argument.
    
    To update the test, I computed the expected results separately
    by using the physical formula.
    
    Happily, the framework by default never ends up actually exercising
    this code.  Of the four SpringDescription call sites within the
    framework, two are explicitly overdamped; the other two are by
    design critically damped, but due to rounding they end up being
    treated as (very slightly) overdamped too.  Details here:
      https://github.com/flutter/flutter/issues/109675#issuecomment-1423674855
    
    So the only way an app could be affected by this bug is if it called
    a SpringDescription constructor itself, and managed to create a spring
    description where the distinguishing formula in _SpringSolution comes
    out exactly equal to zero.  It's likely nobody has ever shipped such
    an app, because the behavior this produces would be so wildly wrong
    that it'd be hard to miss when exercised.
    Co-authored-by: 's avatarKate Lovett <katelovett@google.com>
    97938859
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
dev Loading commit data...
examples Loading commit data...
packages Loading commit data...
.ci.yaml Loading commit data...
.cirrus.yml Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CODEOWNERS Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
PATENT_GRANT Loading commit data...
README.md Loading commit data...
TESTOWNERS Loading commit data...
analysis_options.yaml Loading commit data...
dartdoc_options.yaml Loading commit data...
flutter_console.bat Loading commit data...