From b6378770cd30a03e9db0ce8b81670411087c998f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 30 Jun 2020 16:32:37 +0200 Subject: vertical timeline --- .../frontend/views/align/components/ticks.component.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'animism-align/frontend/views/align/components/ticks.component.js') diff --git a/animism-align/frontend/views/align/components/ticks.component.js b/animism-align/frontend/views/align/components/ticks.component.js index 8f59c31..55821ae 100644 --- a/animism-align/frontend/views/align/components/ticks.component.js +++ b/animism-align/frontend/views/align/components/ticks.component.js @@ -6,11 +6,11 @@ import { timestamp } from '../../../util' export default class Ticks extends Component { render() { let { start_ts, zoom, duration } = this.props.timeline - const width = window.innerWidth + const width = window.innerHeight let secondsPerPixel = ZOOM_STEPS[zoom] * 0.1 // 0.1 sec / step - let widthTimeDuration = window.innerWidth * secondsPerPixel // secs per pixel + let widthTimeDuration = width * secondsPerPixel // secs per pixel let timeMin = start_ts let timeMax = Math.min(start_ts + widthTimeDuration, duration) @@ -29,8 +29,8 @@ export default class Ticks extends Component { let labelCount = Math.ceil(width / pixelsPerLabel) + 1 let offset, timing, tickLabels = [], ticks = [] for (var i = -1; i < labelCount; i++) { - offset = i * pixelsPerLabel + startOffset - 20 - if (offset + 20 > width) continue + offset = i * pixelsPerLabel + startOffset + if (offset > width) continue timing = i * secondsPerLabel + startTiming if (timing > duration) { break @@ -38,7 +38,7 @@ export default class Ticks extends Component { tickLabels.push(
{timestamp(timing)}
@@ -50,7 +50,7 @@ export default class Ticks extends Component { tickLabels.push(
{timestamp(duration, 1)}
@@ -58,7 +58,7 @@ export default class Ticks extends Component { ticks.push(
) @@ -72,7 +72,7 @@ export default class Ticks extends Component { ticks.push(
) -- cgit v1.2.3-70-g09d2