fix: adjust percentage calculation for current time in setCurrentTime function

This commit is contained in:
Harvey Zhao committed 2026-04-01 12:49:43 +08:00
1 parent 6aa6f9ad53
commit 7e0b84ba7c
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1201,7 +1201,7 @@ ${line.text}`;
}
function setCurrentTime(art, event) {
if (art.isRotate) {
const percentage = event.touches[0].clientY / art.height;
const percentage = (event.touches[0].clientY - art.top) / art.height;
const second = percentage * art.duration;
art.emit("setBar", "played", percentage, event);
art.seek = second;
+1 -1
View File
@@ -13,7 +13,7 @@ export function getPosFromEvent(art, event) {
export function setCurrentTime(art, event) {
if (art.isRotate) {
const percentage = event.touches[0].clientY / art.height
const percentage = (event.touches[0].clientY - art.top) / art.height
const second = percentage * art.duration
art.emit('setBar', 'played', percentage, event)
art.seek = second