Skip to content

Commit 898fbd7

Browse files
authored
fix(Renderer): fix cursor jump at end of playback (#4160)
1 parent c9d7239 commit 898fbd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/renderer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,9 @@ class Renderer extends EventEmitter<RendererEvents> {
766766
this.canvasWrapper.style.clipPath = `polygon(${percents}% 0%, 100% 0%, 100% 100%, ${percents}% 100%)`
767767
this.progressWrapper.style.width = `${percents}%`
768768
this.cursor.style.left = `${percents}%`
769-
this.cursor.style.transform = `translateX(-${Math.round(percents) === 100 ? this.options.cursorWidth : 0}px)`
769+
this.cursor.style.transform = this.options.cursorWidth
770+
? `translateX(-${progress * this.options.cursorWidth}px)`
771+
: ''
770772

771773
if (this.isScrollable && this.options.autoScroll) {
772774
this.scrollIntoView(progress, isPlaying)

0 commit comments

Comments
 (0)