Esempio n. 1
0
        private void OnMouseDown()
        {
            if (Event.current.button == 0)
            {
                var nearestControlPoint = ControlPoints.Find(cp => cp.ControlId == HandleUtility.nearestControl);
                if (nearestControlPoint != null && !nearestControlPoint.DragPoint.IsLocked)
                {
                    if (!Event.current.control)
                    {
                        ClearAllSelection();
                        nearestControlPoint.IsSelected = true;
                    }
                    else
                    {
                        nearestControlPoint.IsSelected = !nearestControlPoint.IsSelected;
                    }

                    Event.current.Use();
                }
            }
        }
Esempio n. 2
0
 private ControlPoint GetControlPoint(int controlId)
 => ControlPoints.Find(cp => cp.ControlId == controlId);