Animate only once.

master
David Peer 2022-05-07 17:12:53 +02:00
parent d07124b749
commit 6a9ca6f32a
1 changed files with 5 additions and 6 deletions

View File

@ -173,7 +173,10 @@ Bangle.on('lcdPower', function(on){
}); });
function animateColor(speed, fun){ function drawAnimated(){
queueDraw();
speed = 25;
// Animate lock // Animate lock
setTimeout(function() { setTimeout(function() {
draw(false, 1); draw(false, 1);
@ -184,7 +187,6 @@ function animateColor(speed, fun){
setTimeout( setTimeout(
function(){ function(){
draw(false, 0); draw(false, 0);
fun();
} }
), speed; ), speed;
}, speed); }, speed);
@ -194,7 +196,6 @@ function animateColor(speed, fun){
Bangle.on('lock', function(isLocked) { Bangle.on('lock', function(isLocked) {
queueDraw();
if(!settings.showLock){ if(!settings.showLock){
draw(false, 0); draw(false, 0);
@ -202,9 +203,7 @@ Bangle.on('lock', function(isLocked) {
} }
// Animate in case the use selected this setting. // Animate in case the use selected this setting.
animateColor(5, function(){ drawAnimated();
animateColor(5, function(){});
});
}); });