Stop asserting that zero duration animations take time #6206

Merged
merged 2 commits into from Dec 5, 2016

Projects

None yet

2 participants

@tschaub
Member
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
dfbc7bb
@fredj
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
Details
coverage/coveralls Coverage decreased (-0.008%) to 86.592%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment