Skip to content

Commit

Permalink
timeline plugin: negative offset rendering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
othmar52 committed Mar 4, 2022
1 parent 8d33268 commit 8979c1d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/plugin/timeline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,13 @@ export default class TimelinePlugin {
// build an array of position data with index, second and pixel data,
// this is then used multiple times below
const positioning = [];
for (i = 0; i < totalSeconds / timeInterval; i++) {

// render until end in case we have a negative offset
const renderSeconds = (this.params.offset < 0)
? totalSeconds - this.params.offset
: totalSeconds;

for (i = 0; i < renderSeconds / timeInterval; i++) {
positioning.push([i, curSeconds, curPixel]);
curSeconds += timeInterval;
curPixel += pixelsPerSecond * timeInterval;
Expand Down

0 comments on commit 8979c1d

Please sign in to comment.