From 7147caa37a888ac27cc1c9e286443431841b4839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20Kati=C4=87?= Date: Sat, 7 Feb 2026 19:08:04 +0100 Subject: [PATCH] Fix clips not retaining colors or names after using "Clear notes out of bounds" (#8234) --- src/gui/clips/MidiClipView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/clips/MidiClipView.cpp b/src/gui/clips/MidiClipView.cpp index c92215d65..17604eb19 100644 --- a/src/gui/clips/MidiClipView.cpp +++ b/src/gui/clips/MidiClipView.cpp @@ -374,9 +374,8 @@ void MidiClipView::clearNotesOutOfBounds() m_clip->getTrack()->addJournalCheckPoint(); m_clip->getTrack()->saveJournallingState(false); - auto newClip = new MidiClip(static_cast(m_clip->getTrack())); - newClip->setAutoResize(m_clip->getAutoResize()); - newClip->movePosition(m_clip->startPosition()); + auto newClip = m_clip->clone(); + newClip->clearNotes(); TimePos startBound = -m_clip->startTimeOffset(); TimePos endBound = m_clip->length() - m_clip->startTimeOffset(); @@ -394,6 +393,7 @@ void MidiClipView::clearNotesOutOfBounds() newClip->addNote(newNote, false); } } + newClip->setStartTimeOffset(0); newClip->changeLength(m_clip->length()); newClip->updateLength();