Пример #1
0
        /// <summary>
        /// Finishes the moving operation.
        /// </summary>
        private void MapMouseUp(IMuteMap map, MouseEventArgs e)
        {
            if (!Active || _currentObject.LayerHandle == -1)
            {
                return;
            }

            if (e.X == _currentObject.X || e.Y == _currentObject.Y)
            {
                ResetRotation();
                Clear();
                return;
            }

            if (!map.EventWithinMap(e))
            {
                ResetRotation();
                Clear();
                return;
            }

            var ctrlDown  = Control.ModifierKeys.HasFlag(Keys.Control);
            var shiftDown = Control.ModifierKeys.HasFlag(Keys.Shift);

            RotateSymbol(map, e.X, e.Y, shiftDown, ctrlDown);
            Clear();
        }
Пример #2
0
        /// <summary>
        /// Finishes the moving operation.
        /// </summary>
        private void MapMouseUp(IMuteMap map, MouseEventArgs e)
        {
            if (!Active || _currentObject.LayerHandle == -1)
            {
                return;
            }

            if (e.X == _currentObject.X || e.Y == _currentObject.Y)
            {
                Clear();
                return;
            }

            if (!map.EventWithinMap(e))
            {
                Clear();
                return;
            }

            // Get the distance the object was moved (in projected coordinates)
            _currentObject.GetProjectedEventDelta(map, e, out double dx, out double dy);

            // Move the object
            if (_currentObject.IsChart)
            {
                MoveChart(map, dx, dy);
            }
            else
            {
                MoveLabel(map, dx, dy);
            }

            // Clear the mover
            Clear();
        }