MCPcopy Create free account
hub / github.com/jerryuhoo/Fire / removePoint

Method removePoint

Source/Panels/ControlPanel/LfoPanel.cpp:646–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644}
645
646void LfoEditor::removePoint(int index)
647{
648 if (! dataIsActive || index <= 0 || index >= activeLfoData.points.size() - 1)
649 return;
650
651 activeLfoData.points.erase(activeLfoData.points.begin() + index);
652
653 // Removing a point merges two segments. We must remove one curvature value.
654 // We remove the curvature of the first of the two merged segments.
655 activeLfoData.curvatures.erase(activeLfoData.curvatures.begin() + index - 1);
656
657 // We then set the curvature of the new, merged segment to 0.0 (linear).
658 if (index - 1 < activeLfoData.curvatures.size())
659 {
660 activeLfoData.curvatures[index - 1] = 0.0f;
661 }
662
663 repaint();
664}
665
666juce::Point<float> LfoEditor::toNormalized(juce::Point<int> localPoint)
667{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected