Beispiel #1
0
        private RenderEdge CreateEdge(PlacementEdge edge, ReferenceType types)
        {
            var(from, to) = RenderPosition(edge);
            var verticalOffset   = new Position(0, _config.Dimensions.Height / 2);
            var horizontalOffset = new Position(_config.Dimensions.Width, 0);

            if (edge.From.X <= edge.To.X)
            {
                from += horizontalOffset;
            }
            else
            {
                to += horizontalOffset;
            }

            from += verticalOffset;
            to   += verticalOffset;
            var edgeLabel     = from.X < to.X ? _config.EdgeLabel : _config.BackwardEdgeLabel;
            var labelPosition = (from + to) / 2 + edgeLabel.Offset;

            return(new RenderEdge(
                       from: from,
                       to: to,
                       types: types,
                       new RenderElement(labelPosition, edgeLabel.Dimensions)
                       ));
        }
Beispiel #2
0
        private (Position From, Position To) RenderPosition(PlacementEdge edge)
        {
            var from = RenderPosition(edge.From, _config.Offsets, _config.Dimensions, _config.Intervals);
            var to   = RenderPosition(edge.To, _config.Offsets, _config.Dimensions, _config.Intervals);

            return(from, to);
        }