add extra adjust sequence logic.
This commit is contained in:
parent
9222e60b58
commit
4cdc73ca90
|
@ -102,6 +102,13 @@ export function movePulseUp(pattern: Pattern, pulseId: string, step: number) {
|
|||
pattern.pulses[targetIndex] = currentPulse;
|
||||
pattern.pulses[index] = targetPulse;
|
||||
|
||||
// If the target pulse's order is 1, swap their offsets
|
||||
if (targetPulse.order === 1) {
|
||||
const tempOffset = currentPulse.offset;
|
||||
currentPulse.offset = targetPulse.offset;
|
||||
targetPulse.offset = tempOffset;
|
||||
}
|
||||
|
||||
// Swap their order
|
||||
const tempOrder = currentPulse.order;
|
||||
currentPulse.order = targetPulse.order;
|
||||
|
@ -123,6 +130,13 @@ export function movePulseDown(pattern: Pattern, pulseId: string, step: number) {
|
|||
pattern.pulses[targetIndex] = currentPulse;
|
||||
pattern.pulses[index] = targetPulse;
|
||||
|
||||
// If the current pulse's order is 1, swap their offsets
|
||||
if (currentPulse.order === 1) {
|
||||
const tempOffset = currentPulse.offset;
|
||||
currentPulse.offset = targetPulse.offset;
|
||||
targetPulse.offset = tempOffset;
|
||||
}
|
||||
|
||||
// Swap their order
|
||||
const tempOrder = currentPulse.order;
|
||||
currentPulse.order = targetPulse.order;
|
||||
|
|
Loading…
Reference in New Issue
Block a user