Пример #1
0
        protected override void OnDeselected()
        {
            base.OnDeselected();

            // throw away frame buffers on deselection.
            ControlPointVisualiser?.Expire();
            BodyPiece.RecyclePath();
        }
Пример #2
0
        public override bool HandleQuickDeletion()
        {
            var hoveredControlPoint = ControlPointVisualiser?.Pieces.FirstOrDefault(p => p.IsHovered);

            if (hoveredControlPoint == null)
            {
                return(false);
            }

            hoveredControlPoint.IsSelected.Value = true;
            ControlPointVisualiser.DeleteSelected();
            return(true);
        }
Пример #3
0
        protected override bool OnMouseDown(MouseDownEvent e)
        {
            switch (e.Button)
            {
            case MouseButton.Right:
                rightClickPosition = e.MouseDownPosition;
                return(false);    // Allow right click to be handled by context menu

            case MouseButton.Left:
                if (e.ControlPressed && IsSelected)
                {
                    changeHandler?.BeginChange();
                    placementControlPoint = addControlPoint(e.MousePosition);
                    ControlPointVisualiser?.SetSelectionTo(placementControlPoint);
                    return(true);    // Stop input from being handled and modifying the selection
                }

                break;
            }

            return(false);
        }