Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions OpenUtau/Controls/PianoRoll.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ private void NotesCanvasLeftPointerPressed(Control control, PointerPoint point,
editState = new NoteResizeEditState(
control, ViewModel, this, noteHitInfo.note,
args.KeyModifiers == KeyModifiers.Alt,
args.KeyModifiers == KeyModifiers.Shift,
fromStart: noteHitInfo.hitResizeAreaFromStart);
Cursor = ViewConstants.cursorSizeWE;
} else if (args.KeyModifiers == cmdKey) {
Expand Down
6 changes: 6 additions & 0 deletions OpenUtau/Views/NoteEditStates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class NoteResizeEditState : NoteEditState {
public readonly UNote? neighborNote;
public readonly bool resizeNeighbor;
public readonly bool fromStart;
public readonly bool ripple;
protected override string? commandNameKey => "command.note.edit";

public NoteResizeEditState(
Expand All @@ -307,6 +308,7 @@ public NoteResizeEditState(
IValueTip valueTip,
UNote note,
bool resizeNeighbor,
bool ripple,
bool fromStart = false) : base(control, vm, valueTip) {
this.note = note;
var notesVm = vm.NotesViewModel;
Expand All @@ -327,6 +329,7 @@ public NoteResizeEditState(
neighborNote = note.Next;
}
this.fromStart = fromStart;
this.ripple = ripple;
}
public override void Update(IPointer pointer, Point point) {
var project = DocManager.Inst.Project;
Expand Down Expand Up @@ -378,6 +381,9 @@ public override void Update(IPointer pointer, Point point) {
}
if (fromStart) {
DocManager.Inst.ExecuteCmd(new MoveNoteCommand(part, note, -deltaDuration, 0));
} else if (ripple) {
var rippleNotes = part.notes.Where(n => n.position > note.position).ToList();
DocManager.Inst.ExecuteCmd(new MoveNoteCommand(part, rippleNotes, deltaDuration, 0));
}
DocManager.Inst.ExecuteCmd(new ResizeNoteCommand(part, note, deltaDuration));
valueTip.UpdateValueTip(note.duration.ToString());
Expand Down
Loading