Skip to content

Commit 124cc98

Browse files
committed
Fix assignment bug in envelopes
1 parent 5cc2283 commit 124cc98

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

The-Orm/EditorView.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,8 +1500,10 @@ void EditorView::configureEnvelopeSlot(int slotIndex, const juce::String& varian
15001500

15011501
const auto& variant = envelopeVariantById(variantId.isEmpty() ? slot.envelopeBinding.variantId : variantId);
15021502
bool variantChanged = !slot.envelopeBinding.variantId.equalsIgnoreCase(variant.id);
1503+
bool stageCountChanged = slot.envelope->stageCount() != static_cast<int>(variant.stages.size());
15031504
slot.envelopeBinding.variantId = variant.id;
1504-
slot.envelope->setSpecification(makeSpecificationFromVariant(variant));
1505+
if (variantChanged || stageCountChanged)
1506+
slot.envelope->setSpecification(makeSpecificationFromVariant(variant));
15051507

15061508
auto targetSize = variant.stages.size();
15071509
auto currentSize = slot.envelopeBinding.stages.size();

0 commit comments

Comments
 (0)