Skip to content

Commit

Permalink
將Kkeyfunction跟Lkeyfunction的reactTime參數預設為0,方便以後呼叫
Browse files Browse the repository at this point in the history
  • Loading branch information
anosanstudio committed Nov 9, 2021
1 parent e67ad87 commit 4c70d12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function MakeSub(SubSequence) {
}
}

function Kkeyfunction(video, reactTime) {
function Kkeyfunction(video, reactTime = 0) {
if (currentStamping >= lines.length) {
return;
}
Expand All @@ -275,7 +275,7 @@ function Kkeyfunction(video, reactTime) {
currentStamping += 1;
}

function Lkeyfunction(video, reactTime) {
function Lkeyfunction(video, reactTime = 0) {
lines[currentStamping] = [
lines[currentStamping][0],
video.currentTime - reactTime
Expand Down Expand Up @@ -309,7 +309,7 @@ document.getElementById("subtainer").addEventListener('mousedown', function (e)
GetnewWidth();
currentStamping = (Number(SubSequence) - 1);
video.currentTime = (SubWidth[SubSequence] - newWidth + SubLeft[SubSequence]) / pxPerSec;
Kkeyfunction(video, 0);
Kkeyfunction(video);
updateContent();
}
}
Expand All @@ -329,7 +329,7 @@ document.getElementById("subtainer").addEventListener('mousedown', function (e)
GetnewWidth();
currentStamping = Number(SubSequence);
video.currentTime = (newWidth + SubLeft[SubSequence]) / pxPerSec;
Lkeyfunction(video, 0);
Lkeyfunction(video);
updateContent();
}
}
Expand Down

0 comments on commit 4c70d12

Please sign in to comment.