AlphaTab.Rendering.Staves.BarLayoutingInfo.AddBeatSpring C# (CSharp) Method

AddBeatSpring() public method

public AddBeatSpring ( Beat beat, float beatSize, float preBeatSize ) : Spring
beat AlphaTab.Model.Beat
beatSize float
preBeatSize float
return Spring
        public Spring AddBeatSpring(Beat beat, float beatSize, float preBeatSize)
        {
            return AddSpring(beat.AbsoluteStart, beat.CalculateDuration(), beatSize, preBeatSize);
        }

Usage Example

 public void RegisterLayoutingInfo(BarLayoutingInfo layoutings)
 {
     var preBeatStretch = PreNotes.Width + OnNotes.Width / 2;
     layoutings.AddBeatSpring(Beat, MinWidth, preBeatStretch);
     // store sizes for special renderers like the EffectBarRenderer
     layoutings.SetPreBeatSize(Beat, PreNotes.Width);
     layoutings.SetOnBeatSize(Beat, OnNotes.Width);
 }