DoLayout() public method

public DoLayout ( ) : void
return void
Beispiel #1
0
        public override void Paint(float cx, float cy, ICanvas canvas)
        {
            base.Paint(cx, cy, canvas);
            NumberGlyph numberGlyph;
            bool        top = false;

            switch (_clefOttavia)
            {
            case ClefOttavia._15ma:
                numberGlyph = new NumberGlyph(Width / 2, 0, 15, 0.5f);
                top         = true;
                break;

            case ClefOttavia._8va:
                numberGlyph = new NumberGlyph(0, 0, 8, 0.5f);
                top         = true;
                break;

            case ClefOttavia._8vb:
                numberGlyph = new NumberGlyph(0, 0, 8, 0.5f);
                break;

            case ClefOttavia._15mb:
                numberGlyph = new NumberGlyph(0, 0, 15, 0.5f);
                break;

            default:
                return;
            }

            int offset;

            switch (_clef)
            {
            case Clef.Neutral:
                offset = top ? -25 : 10;
                break;

            case Clef.C3:
                offset = top ? -30 : 20;
                break;

            case Clef.C4:
                offset = top ? -30 : 20;
                break;

            case Clef.F4:
                offset = top ? -25 : 20;
                break;

            case Clef.G2:
                offset = top ? -50 : 25;
                break;

            default:
                return;
            }

            numberGlyph.Renderer = Renderer;
            numberGlyph.DoLayout();

            var x = (Width - numberGlyph.Width) / 2;

            numberGlyph.Paint(cx + X + x, cy + Y + offset * Scale, canvas);
        }