Stop asserting that zero duration animations take time #6206

merged 2 commits into from Dec 5, 2016


None yet

2 participants

tschaub commented Dec 4, 2016 edited

A bad assertion snuck in with #6202. When calling view.animate() with duration: 0, view.getAnimating() is true if called in the same millisecond as view.animate() (because (0 / 0 >= 1) === false). However, it is false if called in the next millisecond (because (1 / 0 >= 1) === true). We don't want to be testing whether a these calls occur in the same millisecond.

In addition to removing this bad assertion, this more explicitly guards against division by zero (treating zero duration animations as immediately complete).

tschaub added some commits Dec 4, 2016
@tschaub tschaub Stop asserting that zero duration animations take time 12add87
@tschaub tschaub Stop dividing by zero
fredj approved these changes Dec 5, 2016 View changes
@tschaub tschaub merged commit c8064d1 into openlayers:master Dec 5, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
coverage/coveralls Coverage decreased (-0.008%) to 86.592%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment