Fix first envelope line segment not being rendered in editor

Rendering was started with the second line segment after one time step has already passed.
This commit is contained in:
Robert Müller 2024-02-25 23:33:11 +01:00
parent 7c4d51f111
commit 5aab9969ce

View file

@ -6639,9 +6639,9 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
float StepSize = (EndX - StartX) / static_cast<float>(Steps);
ColorRGBA Channels = ColorRGBA(0.0f, 0.0f, 0.0f, 0.0f);
pEnvelope->Eval(StartTime + StepTime, Channels, c + 1);
pEnvelope->Eval(StartTime, Channels, c + 1);
float PrevY = EnvelopeToScreenY(View, Channels[c]);
for(int i = 2; i < Steps; i++)
for(int i = 1; i < Steps; i++)
{
Channels = ColorRGBA(0.0f, 0.0f, 0.0f, 0.0f);
pEnvelope->Eval(StartTime + i * StepTime, Channels, c + 1);