private static float DistanceToPoint(SideDataControl s, Vector2 point)
        {
            var p1 = GetPivot(s.getStart());
            var p2 = GetPivot(s.getEnd());

            return(HandleUtility.DistancePointToLineSegment(point, p1, p2));
        }
            private Rect[] GetEditingRects(SideDataControl side)
            {
                var p1 = GetPivot(side.getStart());
                var p2 = GetPivot(side.getEnd());

                lengthContent.text = side.getLength().ToString();
                Rect rect = new Rect();

                rect.size   = GUI.skin.textField.CalcSize(lengthContent);
                rect.center = (p1 + p2) / 2f;

                var deleteRect = rect;

                deleteRect.position += new Vector2(deleteRect.size.x, 0);
                deleteRect.size      = new Vector2(deleteRect.size.y, deleteRect.size.y);

                return(new Rect[] { rect, deleteRect });
            }
 private bool IsPairingStartOrEnd(SideDataControl s, NodeDataControl node)
 {
     return((s.getStart() == pairing && s.getEnd() == node) || (s.getEnd() == pairing && s.getStart() == node));
 }