Merge pull request #803 from ahocevar/tween-framerate
Tween: skip frames when minimum frame rate is not reached. r=@bartvde
This commit is contained in:
@@ -74,6 +74,39 @@
|
||||
tween.stop();
|
||||
t.ok(tween.animationId != null, "stop method doesn't do anything if tween isn't running");
|
||||
}
|
||||
|
||||
function test_Tween_skip(t) {
|
||||
t.plan(2);
|
||||
|
||||
var tween = new OpenLayers.Tween();
|
||||
var log = 0;
|
||||
tween.start({count: 0}, {count: 10}, 10, {
|
||||
callbacks: {
|
||||
eachStep: function() {
|
||||
log++;
|
||||
}
|
||||
},
|
||||
minFrameRate: 10000
|
||||
});
|
||||
|
||||
t.delay_call(0.8, function() {
|
||||
t.eq(log, 0, 'all frames skipped at a frame rate of 10000');
|
||||
|
||||
log = 0;
|
||||
tween.start({count: 0}, {count: 10}, 10, {
|
||||
callbacks: {
|
||||
eachStep: function() {
|
||||
log++;
|
||||
}
|
||||
},
|
||||
minFrameRate: 1
|
||||
});
|
||||
});
|
||||
|
||||
t.delay_call(1.6, function() {
|
||||
t.eq(log, 11, 'no frames skipped at a frame rate of 1');
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user