|
@@ -311,14 +311,17 @@ async function processSplitConfig() {
|
|
images.push(image);
|
|
images.push(image);
|
|
}
|
|
}
|
|
|
|
|
|
- // 裁切块,可能是一块,两块,三块... [start, width ...] => [0, 0.3] | [0, 0.55, 0.45, 0.55] | [0, 0.35, 0.33, 0.35, 0.66, 0.35]
|
|
|
|
// 如果拒绝裁切,则保持整卷
|
|
// 如果拒绝裁切,则保持整卷
|
|
if (!store.setting.enableSplit) {
|
|
if (!store.setting.enableSplit) {
|
|
store.setting.splitConfig = [0, 1];
|
|
store.setting.splitConfig = [0, 1];
|
|
}
|
|
}
|
|
|
|
+ // 裁切块,可能是一块,两块,三块... [start, width ...] => [0, 0.3] | [0, 0.55, 0.45, 0.55] | [0, 0.35, 0.33, 0.35, 0.66, 0.35]
|
|
|
|
+ // 要转变为 [[0, 0.3]] | [[0, 0.55], [0.45, 0.55]] | [[0, 0.35], [0.33, 0.35], [0.66, 0.35]]
|
|
const splitConfigPairs = store.setting.splitConfig
|
|
const splitConfigPairs = store.setting.splitConfig
|
|
- .filter((v, index) => index % 2 === 0)
|
|
|
|
- .map<[number, number]>((v, index, ary) => [v, ary[index + 1]]);
|
|
|
|
|
|
+ .map<[number, number]>((v, index, ary) =>
|
|
|
|
+ index % 2 === 0 ? [v, ary[index + 1]] : [0, 0]
|
|
|
|
+ )
|
|
|
|
+ .filter((v) => v[0] === 0 && v[1] === 0);
|
|
|
|
|
|
// 最大的 splitConfig 的宽度
|
|
// 最大的 splitConfig 的宽度
|
|
const maxSplitConfig = Math.max(
|
|
const maxSplitConfig = Math.max(
|
|
@@ -700,7 +703,8 @@ function scrollToFirstScore() {
|
|
window.requestAnimationFrame(scrollToFirstScore);
|
|
window.requestAnimationFrame(scrollToFirstScore);
|
|
}
|
|
}
|
|
addTimeout(() => {
|
|
addTimeout(() => {
|
|
- let firstScore = document.querySelector<HTMLDivElement>(".score-container");
|
|
|
|
|
|
+ const firstScore =
|
|
|
|
+ document.querySelector<HTMLDivElement>(".score-container");
|
|
firstScore?.scrollIntoView({ behavior: "smooth" });
|
|
firstScore?.scrollIntoView({ behavior: "smooth" });
|
|
}, 1000);
|
|
}, 1000);
|
|
}
|
|
}
|