pace: fix pace calculation
parent
a19d56c860
commit
281b178613
|
|
@ -64,11 +64,6 @@ const layout = new Layout({
|
||||||
lazy: true
|
lazy: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const calculatePace = (split: Split) => {
|
|
||||||
if (split.dist === 0) return 0;
|
|
||||||
return split.time / split.dist / 1000 / 60;
|
|
||||||
};
|
|
||||||
|
|
||||||
const draw = () => {
|
const draw = () => {
|
||||||
if (!exs.state.active) {
|
if (!exs.state.active) {
|
||||||
// no draw-timeout here, only on user interaction
|
// no draw-timeout here, only on user interaction
|
||||||
|
|
@ -104,6 +99,9 @@ const formatDuration = (ms: number) => {
|
||||||
return `${pad2(tm.m)}:${pad2(tm.s)}`;
|
return `${pad2(tm.m)}:${pad2(tm.s)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// divide by actual distance, scale to milliseconds
|
||||||
|
const calculatePace = (split: Split) => formatDuration(split.time / split.dist * 1000);
|
||||||
|
|
||||||
const drawSplits = () => {
|
const drawSplits = () => {
|
||||||
g.clearRect(Bangle.appRect);
|
g.clearRect(Bangle.appRect);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue