public override void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll, Vector offset) { canvas.Draw(Mesh); canvas.Draw(Lines); Segment unitBox = NormalizeTime(DataContext, board); double unitThreashold = scroll.ToUnitLength(TextDrawLimit); foreach (TextEntry block in TextBlocks) { double blockWidth = scroll.ToPixelLength(unitBox.Length * block.Width); if (blockWidth < TextDrawLimit) { break; } Point pixelPos = new Point(scroll.ToPixel(unitBox.Start + unitBox.Length * block.Position.X) + TextOffset, offset.Y + block.Position.Y * MaxHeight); canvas.Text.Draw(pixelPos, block.Text, Colors.Black, TextAlignment.Left, blockWidth); } }
public override void Draw(DXCanvas canvas, DXCanvas.Layer layer, IBoard board, ZoomCanvas.ZoomScroll scroll, Vector offset) { canvas.Draw(Mesh); canvas.Draw(Lines); }