aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormonikahedman <monika_hedman@brown.edu>2020-02-11 19:29:19 -0500
committermonikahedman <monika_hedman@brown.edu>2020-02-11 19:29:19 -0500
commit4ecf08b5c5cdc4ddb3a997e2f3a2188e921ff430 (patch)
treefd7387ceb30eef01fa65bf41b68066976c349041 /src
parent02c8bdb41bc7daf8268fde3fe85a9e2f237c772d (diff)
number jitter fixed
Diffstat (limited to 'src')
-rw-r--r--src/client/views/animationtimeline/Timeline.tsx12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/client/views/animationtimeline/Timeline.tsx b/src/client/views/animationtimeline/Timeline.tsx
index 2b0525c6e..e9caa2b2a 100644
--- a/src/client/views/animationtimeline/Timeline.tsx
+++ b/src/client/views/animationtimeline/Timeline.tsx
@@ -329,17 +329,15 @@ export class Timeline extends React.Component<FieldViewProps> {
time = time / 1000;
const inSeconds = Math.round(time * 100) / 100;
- // console.log(inSeconds)
- // var inSeconds = parseFloat(time.toFixed(2));
- // const inSeconds = (Math.floor(time) / 1000);
const min: (string | number) = Math.floor(inSeconds / 60);
- let sec: (string | number) = (Math.round((inSeconds % 60) * 100) / 100);
+ const sec: (string | number) = (Math.round((inSeconds % 60) * 100) / 100);
+ let secString = sec.toFixed(2);
if (Math.floor(sec / 10) === 0) {
- sec = "0" + sec;
+ secString = "0" + secString;
}
- // sec = Number.parseFloat(sec).toFixed(2);
- return `${min}:${sec}`;
+
+ return `${min}:${secString}`;
}