1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-08-20 07:25:59 +00:00

playhead dragging

This commit is contained in:
Cameron Taylor 2023-11-22 19:53:56 -05:00
parent 620cd50c1d
commit d66141c15a

View file

@ -1956,16 +1956,21 @@ class ChartEditorState extends HaxeUIState
}
}
playbarHead.onDrag = function(_:DragEvent) {
if (playbarHeadDragging)
{
var value:Null<Float> = playbarHead?.value;
// Set the song position to where the playhead was moved to.
scrollPositionInPixels = songLengthInPixels * ((value ?? 0.0) / 100);
// Update the conductor and audio tracks to match.
moveSongToScrollPosition();
}
}
playbarHead.onDragEnd = function(_:DragEvent) {
playbarHeadDragging = false;
var value:Null<Float> = playbarHead?.value;
// Set the song position to where the playhead was moved to.
scrollPositionInPixels = songLengthInPixels * ((value ?? 0.0) / 100);
// Update the conductor and audio tracks to match.
moveSongToScrollPosition();
// If we were dragging the playhead while the song was playing, resume playing.
if (playbarHeadDraggingWasPlaying)
{