Commit d5ca00f

Richard Ziegler committed on
Envelope Draw routine improvements.
Can't solve the first draw no clear issue, but it's only first draw.
Removes length line going to the top, keeps bottom line on.
commit d5ca00f9c0d1da1cd8790d1530dd7f05f3611c0c parent 3e8ad4c
1 changed files +5−4
Modifiedtracker.pas +5−4
@@ -544,8 +544,8 @@ var
544 begin 544 begin
545 W := PB.Width; 545 W := PB.Width;
546 H := PB.Height-3; 546 H := PB.Height-3;
547 V := CurrentInstrument^.InitialVolume; 547 V := Min(CurrentInstrument^.InitialVolume,15);
548 S := CurrentInstrument^.VolSweepAmount*2; 548 S := Min(CurrentInstrument^.VolSweepAmount,7)*2;
549 case CurrentInstrument^.LengthEnabled of 549 case CurrentInstrument^.LengthEnabled of
550 True: L := (64-CurrentInstrument^.Length) div 2; 550 True: L := (64-CurrentInstrument^.Length) div 2;
551 False: L := 400; 551 False: L := 400;
@@ -564,6 +564,7 @@ begin
564 LineTo(L*Interval, H-V*HInterval); // no sweep 564 LineTo(L*Interval, H-V*HInterval); // no sweep
565 MoveTo(L*Interval, H-(V*HInterval)); 565 MoveTo(L*Interval, H-(V*HInterval));
566 LineTo(L*Interval, H); 566 LineTo(L*Interval, H);
567 LineTo(W, H);
567 end 568 end
568 else begin 569 else begin
569 case CurrentInstrument^.VolSweepDirection of 570 case CurrentInstrument^.VolSweepDirection of
@@ -571,15 +572,14 @@ begin
571 For I := 0 to V do 572 For I := 0 to V do
572 LineTo( Min(I*S,L)*Interval, H-(V-I)*HInterval); 573 LineTo( Min(I*S,L)*Interval, H-(V-I)*HInterval);
573 LineTo(W, H); 574 LineTo(W, H);
574 MoveTo(Trunc(L*Interval), 0);
575 LineTo(Trunc(L*Interval), H); 575 LineTo(Trunc(L*Interval), H);
576 end; 576 end;
577 Up: begin // Envelope up, check length cut 577 Up: begin // Envelope up, check length cut
578 For I := 0 to 15-V do 578 For I := 0 to 15-V do
579 LineTo( Min(I*S,L)*Interval, (15-V-I)*HInterval+9); 579 LineTo( Min(I*S,L)*Interval, (15-V-I)*HInterval+9);
580 LineTo(L*Interval, H-15*HInterval); 580 LineTo(L*Interval, H-15*HInterval);
581 MoveTo(L*Interval, 0);
582 LineTo(L*Interval, H); 581 LineTo(L*Interval, H);
582 LineTo(W, H);
583 end; 583 end;
584 end; 584 end;
585 end; 585 end;
@@ -1621,6 +1621,7 @@ end;
1621 procedure TfrmTracker.InstrumentNumberSpinnerChange(Sender: TObject); 1621 procedure TfrmTracker.InstrumentNumberSpinnerChange(Sender: TObject);
1622 begin 1622 begin
1623 LoadInstrument(CurrentInstrumentBank, InstrumentNumberSpinner.Value); 1623 LoadInstrument(CurrentInstrumentBank, InstrumentNumberSpinner.Value);
1624 DrawEnvelope(EnvelopePaintBox);
1624 end; 1625 end;
1625 1626
1626 procedure TfrmTracker.LengthSpinnerChange(Sender: TObject); 1627 procedure TfrmTracker.LengthSpinnerChange(Sender: TObject);