From f71f0b3c71b5b2e23b91a7d8c3a3890431f7030e Mon Sep 17 00:00:00 2001 From: tillvit Date: Tue, 26 Dec 2023 01:19:00 -0800 Subject: [PATCH] Fix truncated holds, ssc save path --- app/src/chart/ChartManager.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/chart/ChartManager.ts b/app/src/chart/ChartManager.ts index 936135dd..e470466c 100644 --- a/app/src/chart/ChartManager.ts +++ b/app/src/chart/ChartManager.ts @@ -1124,7 +1124,7 @@ export class ChartManager { beat: number ): PartialNotedataEntry { const newHoldEndBeat = clamp( - Math.round((beat - Options.chart.snap) * 48) / 48, + Math.round((beat - Math.max(1 / 48, Options.chart.snap)) * 48) / 48, hold.beat, hold.beat + hold.hold - 1 / 48 ) @@ -1468,14 +1468,15 @@ export class ChartManager { this.loadedSM.requiresSSC() || (await FileHandler.getFileHandle(sscPath)) ) { - await FileHandler.writeFile(smPath, this.loadedSM.serialize("ssc")).catch( - err => { - const message = err.message - if (!message.includes(errors.GONE[0])) { - error = message - } + await FileHandler.writeFile( + sscPath, + this.loadedSM.serialize("ssc") + ).catch(err => { + const message = err.message + if (!message.includes(errors.GONE[0])) { + error = message } - ) + }) } if (error == null) { if (this.loadedSM.usesChartTiming()) {