mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-12 06:54:41 -04:00
Note rendering broken after BPM change fix
This commit is contained in:
parent
edb270d15e
commit
116d22b98f
1 changed files with 12 additions and 10 deletions
|
@ -1,6 +1,9 @@
|
|||
package funkin.ui.debug.charting.commands;
|
||||
|
||||
import funkin.data.song.SongData.SongTimeChange;
|
||||
import funkin.data.song.SongDataUtils;
|
||||
import funkin.data.song.SongData.SongEventData;
|
||||
import funkin.data.song.SongData.SongNoteData;
|
||||
|
||||
/**
|
||||
* A command which changes the starting BPM of the song.
|
||||
|
@ -34,14 +37,15 @@ class ChangeStartingBPMCommand implements ChartEditorCommand
|
|||
|
||||
state.currentSongMetadata.timeChanges = timeChanges;
|
||||
|
||||
state.noteDisplayDirty = true;
|
||||
state.notePreviewDirty = true;
|
||||
state.notePreviewViewportBoundsDirty = true;
|
||||
state.scrollPositionInPixels = 0;
|
||||
|
||||
Conductor.instance.mapTimeChanges(state.currentSongMetadata.timeChanges);
|
||||
|
||||
state.updateGridHeight();
|
||||
|
||||
// Fix the positions of the notes and events (don't ask me how this works, I have no clue). It just works!
|
||||
// I considered putting this in updateGridHeight() but I've noticed it gets updated in a lot of places, so I won't.
|
||||
|
||||
state.currentSongChartNoteData = SongDataUtils.offsetSongNoteData(state.currentSongChartNoteData, 0);
|
||||
state.currentSongChartEventData = SongDataUtils.offsetSongEventData(cstate.currentSongChartEventData, 0);
|
||||
}
|
||||
|
||||
public function undo(state:ChartEditorState):Void
|
||||
|
@ -58,14 +62,12 @@ class ChangeStartingBPMCommand implements ChartEditorCommand
|
|||
|
||||
state.currentSongMetadata.timeChanges = timeChanges;
|
||||
|
||||
state.noteDisplayDirty = true;
|
||||
state.notePreviewDirty = true;
|
||||
state.notePreviewViewportBoundsDirty = true;
|
||||
state.scrollPositionInPixels = 0;
|
||||
|
||||
Conductor.instance.mapTimeChanges(state.currentSongMetadata.timeChanges);
|
||||
|
||||
state.updateGridHeight();
|
||||
|
||||
state.currentSongChartNoteData = SongDataUtils.offsetSongNoteData(state.currentSongChartNoteData, 0);
|
||||
state.currentSongChartEventData = SongDataUtils.offsetSongEventData(cstate.currentSongChartEventData, 0);
|
||||
}
|
||||
|
||||
public function shouldAddToHistory(state:ChartEditorState):Bool
|
||||
|
|
Loading…
Add table
Reference in a new issue