Beispiel #1
0
        public virtual void DoLayout()
        {
            _preBeatGlyphs           = new LeftToRightLayoutingGlyphGroup();
            _preBeatGlyphs.Renderer  = this;
            _voiceContainers         = new FastDictionary <int, VoiceContainerGlyph>();
            _postBeatGlyphs          = new LeftToRightLayoutingGlyphGroup();
            _postBeatGlyphs.Renderer = this;

            for (int i = 0; i < Bar.Voices.Count; i++)
            {
                var voice = Bar.Voices[i];
                if (HasVoiceContainer(voice))
                {
                    var c = new VoiceContainerGlyph(0, 0, voice);
                    c.Renderer = this;
                    _voiceContainers[Bar.Voices[i].Index] = c;
                }
            }

            if (Bar.SimileMark == SimileMark.SecondOfDouble)
            {
                CanWrap = false;
            }

            CreatePreBeatGlyphs();
            CreateBeatGlyphs();
            CreatePostBeatGlyphs();

            UpdateSizes();
        }
Beispiel #2
0
        public BarRendererBase(Bar bar)
        {
            Bar     = bar;
            IsEmpty = true;

            _preBeatGlyphs           = new LeftToRightLayoutingGlyphGroup();
            _preBeatGlyphs.Renderer  = this;
            _voiceContainers         = new FastDictionary <int, VoiceContainerGlyph>();
            _postBeatGlyphs          = new LeftToRightLayoutingGlyphGroup();
            _postBeatGlyphs.Renderer = this;
        }
Beispiel #3
0
        public void ReLayout()
        {
            // there are some glyphs which are shown only for renderers at the line start, so we simply recreate them
            // but we only need to recreate them for the renderers that were the first of the line or are now the first of the line
            if ((_wasFirstOfLine && !IsFirstOfLine) || (!_wasFirstOfLine && IsFirstOfLine))
            {
                _preBeatGlyphs          = new LeftToRightLayoutingGlyphGroup();
                _preBeatGlyphs.Renderer = this;
                CreatePreBeatGlyphs();
            }

            UpdateSizes();
            RegisterLayoutingInfo();
        }