diff --git a/app/src/chart/ChartRenderer.ts b/app/src/chart/ChartRenderer.ts index 7bdafee0..507485f7 100644 --- a/app/src/chart/ChartRenderer.ts +++ b/app/src/chart/ChartRenderer.ts @@ -617,7 +617,11 @@ export class ChartRenderer extends Container { ...this.chart.timingData.getTimingData("SCROLLS"), ] if (scrolls[0]?.beat != 0) - scrolls.splice(0, 0, { beat: 0, value: 1, type: "SCROLLS" }) + scrolls.splice(0, 0, { + beat: 0, + value: scrolls[0]?.value ?? 1, + type: "SCROLLS", + }) let scrollIndex = bsearch( scrolls, @@ -633,8 +637,6 @@ export class ChartRenderer extends Container { const scroll = scrolls[scrollIndex] scrollIndex++ - if (scroll.value == 0) continue - const scrollStartY = scroll === undefined ? -Infinity * this.getScrollDirection(scrolls[0]?.value ?? 1) @@ -656,7 +658,11 @@ export class ChartRenderer extends Container { ...this.chart.timingData.getTimingData("SCROLLS"), ] if (scrolls[0]?.beat != 0) - scrolls.splice(0, 0, { beat: 0, value: 1, type: "SCROLLS" }) + scrolls.splice(0, 0, { + beat: 0, + value: scrolls[0]?.value ?? 1, + type: "SCROLLS", + }) let scrollIndex = bsearch( scrolls, this.getVisualBeat() + Options.chart.maxDrawBeats, @@ -673,8 +679,6 @@ export class ChartRenderer extends Container { const scroll = scrolls[scrollIndex] scrollIndex-- - if (scroll.value == 0) continue - const scrollStartY = scroll === undefined ? -Infinity * this.getScrollDirection(scrolls[0]?.value ?? 1) @@ -699,12 +703,8 @@ export class ChartRenderer extends Container { ) { const scroll = this.findFirstOnScreenScroll() - const speedMult = this.getCurrentSpeedMult() const pixelsToEffectiveBeats = - 100 / - Options.chart.speed / - Math.abs(speedMult) / - 64 / + (1 / Math.abs(this.getEffectiveBeatsToPixelsRatio())) * Options.chart.zoom const scrollStartY = this.getYPosFromBeat(scroll.beat) diff --git a/app/src/chart/component/edit/Waveform.ts b/app/src/chart/component/edit/Waveform.ts index 08de9dc4..4b1df661 100644 --- a/app/src/chart/component/edit/Waveform.ts +++ b/app/src/chart/component/edit/Waveform.ts @@ -233,7 +233,11 @@ export class Waveform extends Sprite implements ChartRendererComponent { ...this.renderer.chart.timingData.getTimingData("SCROLLS"), ] if (scrolls[0]?.beat != 0) - scrolls.unshift({ type: "SCROLLS", beat: 0, value: 1 }) + scrolls.unshift({ + type: "SCROLLS", + beat: 0, + value: scrolls[0]?.value ?? 1, + }) const startScrollIndex = scrolls.findIndex( a => a.beat == startScroll.beat @@ -258,7 +262,7 @@ export class Waveform extends Sprite implements ChartRendererComponent { )) { if (scroll.value == 0) continue const pixelsToBeats = pixelsToEffectiveBeats / Math.abs(scroll.value) - if (scroll != startScroll) { + if (scroll.beat != startScroll.beat) { currentBeat = scroll.beat } else { // fix flickering by rounding the current beat to land on a pixel @@ -279,7 +283,7 @@ export class Waveform extends Sprite implements ChartRendererComponent { // Stop if the scroll is off the screen if (currentYPos < 0) { // Skip the scroll if we step off the top of the screen - if (scroll.value * scrollDirection < 0) { + if (scrollDirection < 0) { currentBeat = scrollEndBeat break } @@ -290,7 +294,7 @@ export class Waveform extends Sprite implements ChartRendererComponent { if (currentYPos > screenHeight) { // Skip the scroll if we step off the bottom of the screen - if (scroll.value * scrollDirection > 0) { + if (scrollDirection > 0) { currentBeat = scrollEndBeat break } @@ -302,9 +306,7 @@ export class Waveform extends Sprite implements ChartRendererComponent { // Step by 1 or -1 pixels and get the current beat currentBeat += pixelsToBeats * Options.chart.waveform.lineHeight - currentYPos += - (scroll.value * scrollDirection > 0 ? 1 : -1) * - Options.chart.waveform.lineHeight + currentYPos += scrollDirection * Options.chart.waveform.lineHeight curSec = this.calculateSecond( currentBeat, diff --git a/app/src/chart/component/timing/TimingTrackContainer.ts b/app/src/chart/component/timing/TimingTrackContainer.ts index 4162c41e..a0744a44 100644 --- a/app/src/chart/component/timing/TimingTrackContainer.ts +++ b/app/src/chart/component/timing/TimingTrackContainer.ts @@ -541,7 +541,7 @@ export class TimingTrackContainer TIMING_EVENT_COLORS[event.type] ?? 0x000000, Math.sin(Date.now() / 320) * 0.4 + 1.5 ) - : TIMING_EVENT_COLORS[event.type] ?? 0x000000 + : (TIMING_EVENT_COLORS[event.type] ?? 0x000000) box.selection.alpha = inSelection ? 1 : 0 box.visible = !inSelection || !this.renderer.chartManager.eventSelection.shift diff --git a/app/src/chart/sm/TimingData.ts b/app/src/chart/sm/TimingData.ts index 57d25e22..1fa7360a 100644 --- a/app/src/chart/sm/TimingData.ts +++ b/app/src/chart/sm/TimingData.ts @@ -133,7 +133,7 @@ export abstract class TimingData { cache.unshift({ type: "SCROLLS", beat: 0, - value: 1, + value: cache[0].value ?? 1, }) effBeat = cache[0].beat for (let i = 0; i < cache.length - 1; i++) {