• 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
..
animation Loading commit data...
cupertino Loading commit data...
dart Loading commit data...
examples Loading commit data...
foundation Loading commit data...
gestures Loading commit data...
harness Loading commit data...
material Loading commit data...
painting Loading commit data...
physics Loading commit data...
rendering Loading commit data...
scheduler Loading commit data...
semantics Loading commit data...
services Loading commit data...
widgets Loading commit data...
_goldens_io.dart Loading commit data...
_goldens_web.dart Loading commit data...
analysis_options.yaml Loading commit data...
flutter_test_config.dart Loading commit data...
image_data.dart Loading commit data...