summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-01-26 22:04:26 +0100
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-01-26 22:04:26 +0100
commit1bce4de22888eb4b37b17f3a118065012331267e (patch)
tree86d74e4e8966489f08f75d8fcddb9591bd6a9b6f /src
parent3ad08353d289720cf8f43e1dba078da43c35e97d (diff)
Set first tick to be 1 instead of 0
Diffstat (limited to 'src')
-rw-r--r--src/scripts/controllers/simulation/timeline.ts6
-rw-r--r--src/scripts/controllers/simulationcontroller.ts4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/scripts/controllers/simulation/timeline.ts b/src/scripts/controllers/simulation/timeline.ts
index a558afe1..950973a9 100644
--- a/src/scripts/controllers/simulation/timeline.ts
+++ b/src/scripts/controllers/simulation/timeline.ts
@@ -153,9 +153,9 @@ export class TimelineController {
let correction = 0;
if (this.timeUnitFraction * this.timelineWidth > this.timeMarkerWidth) {
correction = (this.timeUnitFraction * this.timelineWidth - this.timeMarkerWidth) *
- (tick / this.simulationController.lastSimulatedTick);
+ ((tick - 1) / this.simulationController.lastSimulatedTick);
}
- return (100 * (this.timeUnitFraction * tick + correction / this.timelineWidth)) + "%";
+ return (100 * (this.timeUnitFraction * (tick - 1) + correction / this.timelineWidth)) + "%";
}
-} \ No newline at end of file
+}
diff --git a/src/scripts/controllers/simulationcontroller.ts b/src/scripts/controllers/simulationcontroller.ts
index 8d9553e9..418b5437 100644
--- a/src/scripts/controllers/simulationcontroller.ts
+++ b/src/scripts/controllers/simulationcontroller.ts
@@ -72,7 +72,7 @@ export class SimulationController {
this.experimentSelectionMode = true;
this.sectionIndex = 0;
- this.currentTick = 0;
+ this.currentTick = 1;
this.playing = false;
this.stateCache = new StateCache(this);
this.colorRepresentation = ColorRepresentation.LOAD;
@@ -340,7 +340,7 @@ export class SimulationController {
this.currentPath = this.getPathById(this.currentExperiment.pathId);
this.sections = this.currentPath.sections;
this.sectionIndex = 0;
- this.currentTick = 0;
+ this.currentTick = 1;
this.playing = false;
this.stateCache = new StateCache(this);
this.colorRepresentation = ColorRepresentation.LOAD;