Merge pull request #6206 from tschaub/zero

Stop asserting that zero duration animations take time
This commit is contained in:
Tim Schaub
2016-12-05 08:59:05 -07:00
committed by GitHub
2 changed files with 1 additions and 2 deletions

View File

@@ -304,7 +304,7 @@ ol.View.prototype.updateAnimations_ = function() {
continue;
}
var elapsed = now - animation.start;
var fraction = elapsed / animation.duration;
var fraction = animation.duration > 0 ? elapsed / animation.duration : 1;
if (fraction >= 1) {
animation.complete = true;
fraction = 1;

View File

@@ -379,7 +379,6 @@ describe('ol.View', function() {
zoom: 4,
duration: 0
});
expect(view.getAnimating()).to.eql(true);
setTimeout(function() {
expect(view.getCenter()).to.eql([0, 0]);