Improve heart rate circle drawing calculation

master
Marco Heiming 2022-01-01 14:13:53 +01:00
parent be8f5ebb67
commit 9b29f5d2c7
1 changed files with 3 additions and 1 deletions

View File

@ -102,7 +102,8 @@ function drawHeartRate() {
g.fillCircle(w2, h3, radiusOuter);
if (hrtValue != undefined && hrtValue > 0) {
const percent = hrtValue / settings.maxHR;
const minHR = 40;
const percent = (hrtValue - minHR) / (settings.maxHR - minHR);
drawGauge(w2, h3, percent, colorRed);
}
@ -166,6 +167,7 @@ function drawGauge(cx, cy, percent, color) {
var i = 0;
var r = radiusInner + 3;
if (percent <= 0) return;
if (percent > 1) percent = 1;
var startrot = -offset;