Skip to content

Commit

Permalink
fix(jukebox): inline tagging respose offset
Browse files Browse the repository at this point in the history
  • Loading branch information
blueset committed Jun 19, 2023
1 parent df8396b commit c5c0abc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { LyricsLine } from "lyrics-kit/core";
import { SetStateAction } from "react";

/** Apply -50ms offset to all keypresses to compensate reflection time. */
const KEY_PRESS_OFFSET_MS = -50;

export const MoveCursorUp =
(lines: LyricsLine[]) =>
(prev: [number, number]): [number, number] => {
Expand Down Expand Up @@ -194,6 +197,7 @@ export function setMark(
setTags: (dots: SetStateAction<number[][][]>) => void,
setDotCursorPos: (pos: SetStateAction<[number, number, number]>) => void
) {
time += KEY_PRESS_OFFSET_MS;
setDotCursorPos((dotCursorPos) => {
setTags((prev) =>
prev.map((i, idx) =>
Expand Down

0 comments on commit c5c0abc

Please sign in to comment.