AlphaTab.Rendering.BarRendererBase.BuildBoundingsLookup C# (CSharp) Method

BuildBoundingsLookup() public method

public BuildBoundingsLookup ( MasterBarBounds masterBarBounds, float cx, float cy ) : void
masterBarBounds AlphaTab.Rendering.Utils.MasterBarBounds
cx float
cy float
return void
        public virtual void BuildBoundingsLookup(MasterBarBounds masterBarBounds, float cx, float cy)
        {
            var barBounds = new BarBounds();
            barBounds.Bar = Bar;
            barBounds.VisualBounds = new Bounds
            {
                X = cx + X,
                Y = cy + Y + TopPadding,
                W = Width,
                H = Height - TopPadding - BottomPadding
            };
            barBounds.RealBounds = new Bounds
            {
                X = cx + X,
                Y = cy + Y,
                W = Width,
                H = Height
            };
            masterBarBounds.AddBar(barBounds);

            foreach (var voice in _voiceContainers)
            {
                var c = _voiceContainers[voice];
                if (!c.Voice.IsEmpty)
                {
                    for (int i = 0, j = c.BeatGlyphs.Count; i < j; i++)
                    {
                        var bc = c.BeatGlyphs[i];

                        var beatBoundings = new BeatBounds();
                        beatBoundings.Beat = bc.Beat;
                        beatBoundings.VisualBounds = new Bounds
                        {
                            X = cx + X + c.X + bc.X + bc.OnNotes.X,
                            Y = barBounds.VisualBounds.Y,
                            W = bc.OnNotes.Width,
                            H = barBounds.VisualBounds.H
                        };
                        beatBoundings.RealBounds = new Bounds
                        {
                            X = cx + X + c.X + bc.X,
                            Y = barBounds.RealBounds.Y,
                            W = bc.Width,
                            H = barBounds.RealBounds.H
                        };
                        barBounds.AddBeat(beatBoundings);
                    }
                }
            }
        }