feat: misc behavior changes

This commit is contained in:
Xiaohan-Tian
2026-07-06 23:28:56 -07:00
parent 5aa74e61a8
commit 93450aebec
7 changed files with 297 additions and 12 deletions
+3
View File
@@ -108,6 +108,7 @@ export const useNoteSelection = ({
// Update last edited note length
const noteLength = note.getEndBeat() - note.getStartBeat();
KGPianoRollState.instance().setLastEditedNoteLength(noteLength);
KGPianoRollState.instance().setLastEditedNoteVelocity(note.getVelocity());
if (DEBUG_MODE.PIANO_ROLL) {
console.log(`Added note to selection: ${noteId}`);
@@ -139,6 +140,7 @@ export const useNoteSelection = ({
// Update last edited note length
const noteLength = note.getEndBeat() - note.getStartBeat();
KGPianoRollState.instance().setLastEditedNoteLength(noteLength);
KGPianoRollState.instance().setLastEditedNoteVelocity(note.getVelocity());
if (DEBUG_MODE.PIANO_ROLL) {
console.log(`Selected note (replacing previous selection): ${noteId}`);
@@ -416,6 +418,7 @@ export const useNoteSelection = ({
const noteLength = closestNote.getEndBeat() - closestNote.getStartBeat();
KGPianoRollState.instance().setLastEditedNoteLength(noteLength);
KGPianoRollState.instance().setLastEditedNoteVelocity(closestNote.getVelocity());
if (DEBUG_MODE.PIANO_ROLL) {
console.log(`Updated last edited note length to ${noteLength} from closest note: ${closestNote.getId()}`);