Use shortest rotation delta for animation
This commit is contained in:
1 parent
0fc710bc48
commit
67f69a32bb
2 files changed
+20
-1
No files matched your search
@@ -494,6 +494,21 @@ describe('ol.View', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('takes the shortest angle to the target rotation', function(done) {
|
||||
var view = new ol.View({
|
||||
center: [0, 0],
|
||||
zoom: 0,
|
||||
rotation: Math.PI / 180 * 1
|
||||
});
|
||||
view.animate({
|
||||
rotation: Math.PI / 180 * 359,
|
||||
duration: 0
|
||||
}, function() {
|
||||
expect(view.getRotation()).to.roughlyEqual(Math.PI / 180 * -1, 1e-12);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('calls a callback when animation completes', function(done) {
|
||||
var view = new ol.View({
|
||||
center: [0, 0],
|
||||
|
||||
Reference in new issue
Block a user