コード例 #1
0
        public override void DoLayout()
        {
            _helpers = Stave.StaveGroup.Helpers.Helpers[Bar.Track.Index][Bar.Index];
            base.DoLayout();


            Height = (LineOffset * 4) + TopPadding + BottomPadding;
            if (Index == 0)
            {
                Stave.RegisterStaveTop(GlyphOverflow);
                Stave.RegisterStaveBottom(Height - GlyphOverflow);
            }

            var top    = GetScoreY(0);
            var bottom = GetScoreY(8);

            for (int i = 0, j = _helpers.BeamHelpers.Count; i < j; i++)
            {
                var v = _helpers.BeamHelpers[i];
                for (int k = 0, l = v.Count; k < l; k++)
                {
                    var h = v[k];
                    //
                    // max note (highest) -> top overflow
                    //
                    var maxNoteY = GetScoreY(GetNoteLine(h.MaxNote));
                    if (h.Direction == BeamDirection.Up)
                    {
                        maxNoteY -= GetStemSize(h.MaxDuration);
                        maxNoteY -= h.FingeringCount * Resources.GraceFont.Size;
                        if (h.HasTuplet)
                        {
                            maxNoteY -= Resources.EffectFont.Size * 2;
                        }
                    }

                    if (maxNoteY < top)
                    {
                        RegisterOverflowTop(Math.Abs(maxNoteY));
                    }

                    //
                    // min note (lowest) -> bottom overflow
                    //t
                    var minNoteY = GetScoreY(GetNoteLine(h.MinNote));
                    if (h.Direction == BeamDirection.Down)
                    {
                        minNoteY += GetStemSize(h.MaxDuration);
                        minNoteY += h.FingeringCount * Resources.GraceFont.Size;
                    }

                    if (minNoteY > bottom)
                    {
                        RegisterOverflowBottom(Math.Abs(minNoteY) - bottom);
                    }
                }
            }
        }
コード例 #2
0
ファイル: TabBarRenderer.cs プロジェクト: ypm0313/alphaTab
 public override void DoLayout()
 {
     _helpers = Stave.StaveGroup.Helpers.Helpers[Bar.Track.Index][Bar.Index];
     base.DoLayout();
     Height = LineOffset * (Bar.Track.Tuning.Length - 1) + (NumberOverflow * 2);
     if (Index == 0)
     {
         Stave.RegisterStaveTop(NumberOverflow);
         Stave.RegisterStaveBottom(Height - NumberOverflow);
     }
 }