AlphaTab.Rendering.Glyphs.BeatContainerGlyph.DoLayout C# (CSharp) Method

DoLayout() public method

public DoLayout ( ) : void
return void
        public override void DoLayout()
        {
            PreNotes.X = 0;
            PreNotes.Renderer = Renderer;
            PreNotes.Container = this;
            PreNotes.DoLayout();

            OnNotes.X = PreNotes.X + PreNotes.Width;
            OnNotes.Renderer = Renderer;
            OnNotes.Container = this;
            OnNotes.DoLayout();
            var i = Beat.Notes.Count - 1;
            while (i >= 0)
            {
                CreateTies(Beat.Notes[i--]);
            }

            MinWidth = PreNotes.Width + OnNotes.Width;
            if (!Beat.IsRest)
            {
                if (OnNotes.BeamingHelper.Beats.Count == 1)
                {
                    // make space for footer
                    if (Beat.Duration >= Duration.Eighth)
                    {
                        MinWidth += 20 * Scale;
                    }
                }
                else
                {
                    // ensure some space for small notes
                    switch (Beat.Duration)
                    {
                        case Duration.OneHundredTwentyEighth:
                        case Duration.TwoHundredFiftySixth:
                            MinWidth += 10 * Scale;
                            break;
                    }
                }
            }

            Width = MinWidth;
            OnTimeX = OnNotes.X + OnNotes.Width / 2;
        }