Esempio n. 1
0
        private static void DrawArrow(DrawingContext context, Point point1, Point point2, SolidColorBrush color)
        {
            var pen        = new Pen(color, 1 * _scale);
            var startPoint = ConvertPoint(point1);
            var endPoint   = ConvertPoint(point2);

            context.DrawLine(pen, startPoint, endPoint);
        }
Esempio n. 2
0
        private static SPoint ConvertPoint(Point point)
        {
            return(new SPoint(
                       scaleCoordinate(point.X),
                       scaleCoordinate(point.Y)
                       ));

            double scaleCoordinate(int coordinate)
            {
                return((coordinate + 0.5) * (_nodeWidth + _bordersWidth) + _bordersWidth);
            }
        }
Esempio n. 3
0
 public void UpdateFieldNodeType(Point point, NodeType newType)
 {
     Nodes.GetNode(point).NodeType = newType;
     FieldNodesChangedEvent?.Invoke(this);
 }