Exemple #1
0
        public bool Rotating(Point worldPosition)
        {
            if (EditMode != EditMode.Rotate || _rotateInfo.Feature == null)
            {
                return(false);
            }

            var previousVector = _rotateInfo.Center - _rotateInfo.PreviousPosition;
            var currentVector  = _rotateInfo.Center - worldPosition;
            var degrees        = AngleBetween(currentVector, previousVector);

            Geomorpher.Rotate(_rotateInfo.Feature.Geometry, degrees, _rotateInfo.Center);

            _rotateInfo.PreviousPosition = worldPosition;

            _rotateInfo.Feature.RenderedGeometry.Clear();
            Layer.DataHasChanged();

            return(true); // to signal pan lock
        }
Exemple #2
0
        public bool Scaling(Point worldPosition)
        {
            if (EditMode != EditMode.Scale || _scaleInfo.Feature == null)
            {
                return(false);
            }

            var scale =
                _scaleInfo.Center.Distance(worldPosition) /
                _scaleInfo.Center.Distance(_scaleInfo.PreviousPosition);


            Geomorpher.Scale(_scaleInfo.Feature.Geometry, scale, _scaleInfo.Center);

            _scaleInfo.PreviousPosition = worldPosition;

            _scaleInfo.Feature.RenderedGeometry.Clear();
            Layer.DataHasChanged();

            return(true); // to signal pan lock
        }