mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 16:17:53 -05:00
Merge pull request #229 from FunkinCrew/polish/playbarhead-drag
playhead dragging
This commit is contained in:
commit
ce11c6bde5
1 changed files with 12 additions and 7 deletions
|
@ -1956,15 +1956,20 @@ class ChartEditorState extends HaxeUIState
|
|||
}
|
||||
}
|
||||
|
||||
playbarHead.onDragEnd = function(_:DragEvent) {
|
||||
playbarHeadDragging = false;
|
||||
|
||||
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;
|
||||
|
||||
// If we were dragging the playhead while the song was playing, resume playing.
|
||||
if (playbarHeadDraggingWasPlaying)
|
||||
|
|
Loading…
Reference in a new issue