private async Task DrawEdgeLine(RenderEdge edge) { await _context.BeginPathAsync(); await _context.MoveToAsync(edge.From.X, edge.From.Y); await _context.LineToAsync(edge.To.X, edge.To.Y); await _context.ClosePathAsync(); await _context.StrokeAsync(); }
private async Task DrawEdge(RenderEdge edge) { var types = edge.Types & _config.Types; if (types == 0) { return; } await DrawEdgeLine(edge); await DrawEdgeLabel(edge, types); }
private async Task DrawEdgeLabel(RenderEdge edge, ReferenceType types) { var typeLabels = types.ToString().Split(", "); var position = edge.Label.Position + new Position(0, edge.Label.Dimensions.Height); var label = typeLabels[0]; if (typeLabels.Length != 1) { label = $"{label} +{typeLabels.Length - 1}"; } await DrawText(label, position, edge.Label.Dimensions.Width, _config.EdgeFont); }