Example #1
0
        public virtual void applySizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
        {
            unchecked
            {
                int size = default(int);
                int diff = default(int);
                size            = sizes.getPreNoteSize(this.beat.start);
                diff            = (size - this.preNotes.width);
                this.preNotes.x = 0;
                if ((diff > 0))
                {
                    this.preNotes.applyGlyphSpacing(diff);
                }

                size           = sizes.getOnNoteSize(this.beat.start);
                diff           = (size - this.onNotes.width);
                this.onNotes.x = (this.preNotes.x + this.preNotes.width);
                if ((diff > 0))
                {
                    this.onNotes.applyGlyphSpacing(diff);
                }

                size             = sizes.getPostNoteSize(this.beat.start);
                diff             = (size - this.postNotes.width);
                this.postNotes.x = (this.onNotes.x + this.onNotes.width);
                if ((diff > 0))
                {
                    this.postNotes.applyGlyphSpacing(diff);
                }

                this.width = this.calculateWidth();
            }
        }
Example #2
0
        public virtual void registerMaxSizes(global::alphatab.rendering.staves.BarSizeInfo sizes)
        {
            unchecked
            {
                if ((sizes.getPreNoteSize(this.beat.start) < this.preNotes.width))
                {
                    sizes.preNoteSizes.@set(this.beat.start, this.preNotes.width);
                }

                if ((sizes.getOnNoteSize(this.beat.start) < this.onNotes.width))
                {
                    sizes.onNoteSizes.@set(this.beat.start, this.onNotes.width);
                }

                if ((sizes.getPostNoteSize(this.beat.start) < this.postNotes.width))
                {
                    sizes.postNoteSizes.@set(this.beat.start, this.postNotes.width);
                }
            }
        }