From 51807e2b9ae988b7130f79ff5dc08150c4b09a6e Mon Sep 17 00:00:00 2001 From: sir-indy <53864146+sir-indy@users.noreply.github.com> Date: Mon, 2 May 2022 12:31:57 +0100 Subject: [PATCH] Update onTouch to work properly --- apps/smpltmr/app.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/smpltmr/app.js b/apps/smpltmr/app.js index 2904fd6a1..63aeafa91 100644 --- a/apps/smpltmr/app.js +++ b/apps/smpltmr/app.js @@ -60,14 +60,12 @@ function onDrag(event) { function onTouch(button, xy) { var touchMidpoint = timePickerLayout.hours.y + timePickerLayout.hours.h/2; var diff = 0; - if (timerRunning() && xy.y > 24 && xy.y < touchMidpoint - 10) { - Bangle.buzz(40, 0.3); + Bangle.buzz(40, 0.3); + if (!timerRunning() && xy.y > 24 && xy.y < touchMidpoint - 10) { diff = 1; - } else if (timerRunning() && xy.y > touchMidpoint + 10 && xy.y < timePickerLayout.btnStart.y) { - Bangle.buzz(40, 0.3); + } else if (!timerRunning() && xy.y > touchMidpoint + 10 && xy.y < timePickerLayout.btnStart.y) { diff = -1; } else if (xy.y > timePickerLayout.btnStart.y) { - Bangle.buzz(40, 0.6); onButton(); return; }