Exemple #1
0
        public static ISelectable HandleSingleSelection(Event evt)
        {
            ISelectable item = PickerUtils.PickedAllElementsOfType <ISelectable>().FirstOrDefault(i => i.CanSelect());

            if (item != null)
            {
                var selected = item.IsSelected();
                if (!selected && CanClearSelection(evt))
                {
                    SelectionManager.Clear();
                }

                if (evt.modifiers == EventModifiers.Shift)
                {
                    if (!selected)
                    {
                        RangeSelectItems((item as TimelineItemGUI)?.item);
                    }
                }
                else
                {
                    HandleItemSelection(evt, item);
                }
            }

            return(item);
        }