Beispiel #1
0
        /// <summary>
        /// Realignes the bars in this line according to the available space
        /// </summary>
        private void FitGroup(StaveGroup group)
        {
            // calculate additional space for each bar (can be negative!)
            float barSpace = 0f;
            float freeSpace = MaxWidth - group.Width;

            if (freeSpace != 0 && group.MasterBars.Count > 0)
            {
                barSpace = freeSpace / group.MasterBars.Count;
            }

            if (group.IsFull || barSpace < 0)
            {
                // add it to the measures
                group.ApplyBarSpacing(barSpace);
            }

            Width = Math.Max(Width, group.Width);
        }