public void ApplySizes(BarSizeInfo sizes) { float size; float diff; size = sizes.GetPreNoteSize(Beat.Start); diff = size - PreNotes.Width; PreNotes.X = 0; if (diff > 0) { PreNotes.ApplyGlyphSpacing(diff); } size = sizes.GetOnNoteSize(Beat.Start); diff = size - OnNotes.Width; OnNotes.X = PreNotes.X + PreNotes.Width; if (diff > 0) { OnNotes.ApplyGlyphSpacing(diff); } size = sizes.GetPostNoteSize(Beat.Start); diff = size - PostNotes.Width; PostNotes.X = OnNotes.X + OnNotes.Width; if (diff > 0) { PostNotes.ApplyGlyphSpacing(diff); } Width = CalculateWidth(); }
public override void Paint(float cx, float cy, ICanvas canvas) { // canvas.Color = new Color(200, 0, 0, 100); // canvas.FillRect(cx + x, cy + y + 15 * Beat.Voice.Index, width, 10); // canvas.Font = new Font("Arial", 10); // canvas.Color = new Color(0, 0, 0); // canvas.FillText(Beat.Voice.Index + ":" + Beat.Index, cx + X, cy + Y + 15 * Beat.Voice.Index); PreNotes.Paint(cx + X, cy + Y, canvas); //canvas.Color = new Color(200, 0, 0, 100); //canvas.FillRect(cx + X + PreNotes.X, cy + Y + PreNotes.Y, PreNotes.Width, 10); OnNotes.Paint(cx + X, cy + Y, canvas); //canvas.Color new Color(0, 200, 0, 100); //canvas.FillRect(cx + X + OnNotes.X, cy + Y + OnNotes.Y + 10, OnNotes.Width, 10); PostNotes.Paint(cx + X, cy + Y, canvas); //canvas.Color = new Color(0, 0, 200, 100); //canvas.FillRect(cx + X + PostNotes.X, cy + Y + PostNotes.Y + 20, PostNotes.Width, 10); for (int i = 0, j = Ties.Count; i < j; i++) { var t = Ties[i]; t.Renderer = Renderer; t.Paint(cx, cy + Y, canvas); } }
public override void DoLayout() { PreNotes.X = 0; PreNotes.Index = 0; PreNotes.Renderer = Renderer; PreNotes.Container = this; PreNotes.DoLayout(); OnNotes.X = PreNotes.X + PreNotes.Width; OnNotes.Index = 1; OnNotes.Renderer = Renderer; OnNotes.Container = this; OnNotes.DoLayout(); PostNotes.X = OnNotes.X + OnNotes.Width; PostNotes.Index = 2; PostNotes.Renderer = Renderer; PostNotes.Container = this; PostNotes.DoLayout(); var i = Beat.Notes.Count - 1; while (i >= 0) { CreateTies(Beat.Notes[i--]); } Width = CalculateWidth(); }
public void FinalizeGlyph(ScoreLayout layout) { PreNotes.FinalizeGlyph(layout); OnNotes.FinalizeGlyph(layout); PostNotes.FinalizeGlyph(layout); }