Beispiel #1
0
        public override void registerMaxSizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
        {
            unchecked
            {
                int preSize = this.getBeatGlyphsStart();
                if ((sizes.getSize("Pre").@value < preSize))
                {
                    sizes.setSize("Pre", preSize);
                }

                {
                    int _g = 0;
                    global::haxe.root.Array <object> _g1 = this._voiceContainers;
                    while ((_g < _g1.length))
                    {
                        global::alphatab.rendering.glyphs.VoiceContainerGlyph c = ((global::alphatab.rendering.glyphs.VoiceContainerGlyph)(_g1[_g]));
                        ++_g;
                        c.registerMaxSizes(sizes);
                    }
                }

                int postSize = default(int);
                if ((this._postBeatGlyphs.length == 0))
                {
                    postSize = 0;
                }
                else
                {
                    postSize = (((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).x + ((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).width);
                }

                if ((sizes.getSize("Post").@value < postSize))
                {
                    sizes.setSize("Post", postSize);
                }

                if ((sizes.fullWidth < this.width))
                {
                    sizes.fullWidth = this.width;
                }
            }
        }
Beispiel #2
0
        public override void applySizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
        {
            unchecked
            {
                global::haxe.lang.Null <int> preSize = sizes.getSize("Pre");
                int preSizeDiff = (preSize.@value - this.getBeatGlyphsStart());
                if ((preSizeDiff > 0))
                {
                    this.addPreBeatGlyph(new global::alphatab.rendering.glyphs.SpacingGlyph(new global::haxe.lang.Null <int>(0, true), new global::haxe.lang.Null <int>(0, true), ((int)(preSizeDiff)), ((global::haxe.lang.Null <bool>)(default(global::haxe.lang.Null <bool>)))));
                }

                {
                    int _g = 0;
                    global::haxe.root.Array <object> _g1 = this._voiceContainers;
                    while ((_g < _g1.length))
                    {
                        global::alphatab.rendering.glyphs.VoiceContainerGlyph c = ((global::alphatab.rendering.glyphs.VoiceContainerGlyph)(_g1[_g]));
                        ++_g;
                        c.applySizes(sizes);
                    }
                }

                global::haxe.lang.Null <int> postSize = sizes.getSize("Post");
                int postSizeDiff = default(int);
                if ((this._postBeatGlyphs.length == 0))
                {
                    postSizeDiff = 0;
                }
                else
                {
                    postSizeDiff = (postSize.@value - ((((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).x + ((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).width)));
                }

                if ((postSizeDiff > 0))
                {
                    this._postBeatGlyphs.insert(0, new global::alphatab.rendering.glyphs.SpacingGlyph(new global::haxe.lang.Null <int>(0, true), new global::haxe.lang.Null <int>(0, true), ((int)(postSizeDiff)), ((global::haxe.lang.Null <bool>)(default(global::haxe.lang.Null <bool>)))));
                    {
                        int _g11 = 0;
                        int _g2  = this._postBeatGlyphs.length;
                        while ((_g11 < _g2))
                        {
                            int i = _g11++;
                            global::alphatab.rendering.Glyph g = ((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[i]));
                            if ((i == 0))
                            {
                                g.x = 0;
                            }
                            else
                            {
                                g.x = (((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).x + ((global::alphatab.rendering.Glyph)(this._postBeatGlyphs[(this._postBeatGlyphs.length - 1)])).width);
                            }

                            g.index    = i;
                            g.renderer = this;
                        }
                    }
                }

                this.updateWidth();
            }
        }