public void ApplySizes(BarSizeInfo sizes)
        {
            float size;
            float diff;

            size       = sizes.GetPreNoteSize(Beat.Start);
            diff       = size - PreNotes.Width;
            PreNotes.X = 0;
            if (diff > 0)
            {
                PreNotes.ApplyGlyphSpacing(diff);
            }

            size      = sizes.GetOnNoteSize(Beat.Start);
            diff      = size - OnNotes.Width;
            OnNotes.X = PreNotes.X + PreNotes.Width;
            if (diff > 0)
            {
                OnNotes.ApplyGlyphSpacing(diff);
            }

            size        = sizes.GetPostNoteSize(Beat.Start);
            diff        = size - PostNotes.Width;
            PostNotes.X = OnNotes.X + OnNotes.Width;
            if (diff > 0)
            {
                PostNotes.ApplyGlyphSpacing(diff);
            }

            Width = CalculateWidth();
        }
        public override void RegisterMaxSizes(BarSizeInfo sizes)
        {
            var preSize = BeatGlyphsStart;

            if (sizes.GetSize(KeySizePre) < preSize)
            {
                sizes.SetSize(KeySizePre, preSize);
            }

            Std.Foreach(_voiceContainers.Values, c => c.RegisterMaxSizes(sizes));

            float postSize;

            if (_postBeatGlyphs.Count == 0)
            {
                postSize = 0;
            }
            else
            {
                postSize = _postBeatGlyphs[_postBeatGlyphs.Count - 1].X + _postBeatGlyphs[_postBeatGlyphs.Count - 1].Width;
            }
            if (sizes.GetSize(KeySizePost) < postSize)
            {
                sizes.SetSize(KeySizePost, postSize);
            }

            if (sizes.FullWidth < Width)
            {
                sizes.FullWidth = Width;
            }
        }
Exemplo n.º 3
0
 public void RegisterMaxSizes(BarSizeInfo sizes)
 {
     for (int i = 0, j = BeatGlyphs.Count; i < j; i++)
     {
         var b = BeatGlyphs[i];
         b.RegisterMaxSizes(sizes);
     }
 }
Exemplo n.º 4
0
        public void ApplySizes(BarSizeInfo sizes)
        {
            Width = 0;
            for (int i = 0, j = BeatGlyphs.Count; i < j; i++)
            {
                BeatGlyphs[i].X = (i == 0) ? 0 : BeatGlyphs[i - 1].X + BeatGlyphs[i - 1].Width;
                BeatGlyphs[i].ApplySizes(sizes);
            }

            if (BeatGlyphs.Count > 0)
            {
                Width = BeatGlyphs[BeatGlyphs.Count - 1].X + BeatGlyphs[BeatGlyphs.Count - 1].Width;
            }
        }
 public void RegisterMaxSizes(BarSizeInfo sizes)
 {
     if (sizes.GetPreNoteSize(Beat.Start) < PreNotes.Width)
     {
         sizes.SetPreNoteSize(Beat.Start, PreNotes.Width);
     }
     if (sizes.GetOnNoteSize(Beat.Start) < OnNotes.Width)
     {
         sizes.SetOnNoteSize(Beat.Start, OnNotes.Width);
     }
     if (sizes.GetPostNoteSize(Beat.Start) < PostNotes.Width)
     {
         sizes.SetPostNoteSize(Beat.Start, PostNotes.Width);
     }
 }
        public override void ApplySizes(BarSizeInfo sizes)
        {
            // if we need additional space in the preBeat group we simply
            // add a new spacer
            var preSize     = sizes.GetSize(KeySizePre);
            var preSizeDiff = preSize - BeatGlyphsStart;

            if (preSizeDiff > 0)
            {
                AddPreBeatGlyph(new SpacingGlyph(0, 0, preSizeDiff));
            }

            // on beat glyphs we apply the glyph spacing
            Std.Foreach(_voiceContainers.Values, c => c.ApplySizes(sizes));

            // on the post glyphs we add the spacing before all other glyphs
            var   postSize = sizes.GetSize(KeySizePost);
            float postSizeDiff;

            if (_postBeatGlyphs.Count == 0)
            {
                postSizeDiff = postSize;
            }
            else
            {
                postSizeDiff = postSize - (_postBeatGlyphs[_postBeatGlyphs.Count - 1].X + _postBeatGlyphs[_postBeatGlyphs.Count - 1].Width);
            }

            if (postSizeDiff > 0)
            {
                _postBeatGlyphs.Insert(0, new SpacingGlyph(0, 0, postSizeDiff));
                for (var i = 0; i < _postBeatGlyphs.Count; i++)
                {
                    var g = _postBeatGlyphs[i];
                    g.X        = i == 0 ? 0 : _postBeatGlyphs[_postBeatGlyphs.Count - 1].X + _postBeatGlyphs[_postBeatGlyphs.Count - 1].Width;
                    g.Index    = i;
                    g.Renderer = this;
                }
            }

            UpdateWidth();
        }
Exemplo n.º 7
0
 public virtual void ApplySizes(BarSizeInfo sizes)
 {
 }
Exemplo n.º 8
0
 public virtual void RegisterMaxSizes(BarSizeInfo sizes)
 {
 }
 public override void ApplySizes(BarSizeInfo sizes)
 {
     base.ApplySizes(sizes);
     Width = sizes.FullWidth;
 }