diff options
Diffstat (limited to 'animism-align/frontend/views/align/components/ticks.component.js')
| -rw-r--r-- | animism-align/frontend/views/align/components/ticks.component.js | 16 |
1 files changed, 8 insertions, 8 deletions
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( <div className='tickLabel' key={"tickLabel_" + i} style={{ - left: Math.floor(offset) + top: Math.floor(offset) }}> {timestamp(timing)} </div> @@ -50,7 +50,7 @@ export default class Ticks extends Component { tickLabels.push( <div className='tickLabel tickLabelTotal' key={"tickLabel_total"} style={{ - left: durationOffset - 20 + top: durationOffset }}> {timestamp(duration, 1)} </div> @@ -58,7 +58,7 @@ export default class Ticks extends Component { ticks.push( <div className='tick' key={"tick_total"} style={{ - left: Math.floor(durationOffset), + top: Math.floor(durationOffset), }} /> ) @@ -72,7 +72,7 @@ export default class Ticks extends Component { ticks.push( <div className='tick' key={"tick_" + i} style={{ - left: Math.floor(offset), + top: Math.floor(offset), }} /> ) |
