diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-21 15:10:15 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:06:04 +0200 |
| commit | 0439ccf76f9ccf68c7572deadf38d6a157c439e7 (patch) | |
| tree | e71d3ac9b2ab443d8c49342cc6c7708ba2a00788 /src/components/timeline | |
| parent | da861719c6433a1fc9346da958f0907e52d578ce (diff) | |
Implement last-simulated-tick and states fetching
Diffstat (limited to 'src/components/timeline')
| -rw-r--r-- | src/components/timeline/TimelineControlsComponent.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/timeline/TimelineControlsComponent.js b/src/components/timeline/TimelineControlsComponent.js index 3f37c3bc..2e093583 100644 --- a/src/components/timeline/TimelineControlsComponent.js +++ b/src/components/timeline/TimelineControlsComponent.js @@ -5,10 +5,10 @@ function getXPercentage(tick, maxTick) { if (maxTick === 0) { return "0%"; } else if (tick > maxTick) { - return "100%"; + return ((maxTick / (maxTick + 1)) * 100) + "%"; } - return (tick / maxTick) + "%"; + return ((tick / (maxTick + 1)) * 100) + "%"; } const TimelineControlsComponent = ({currentTick, lastSimulatedTick, sectionTicks}) => ( |
