예제 #1
0
파일: Scene.cs 프로젝트: lapotkoff/pkis-5
        /// <summary>
        /// Draw line or move layer (depends on pan mode)
        /// </summary>
        /// <param name="p">Point to move</param>
        public void Move(Point p)
        {
            if ((((HasNoLayers) | (!_pressed))) || (!SelectedLayer.IsVisible))
                return;

            if (PanMode)
            {
                var dx = p.X - _lastPoint.X ;
                var dy = p.Y - _lastPoint.Y;
                SelectedLayer.Offset(dx, dy);
            }
            else
            {
                CheckLayerPostionAndSize(new[] { new Point(p.X, p.Y), new Point(_lastPoint.X,_lastPoint.Y)  });
                _points.Add(p);
                SelectedLayer.DrawLines(_pen,_points.Select(c=>c.Normalize(SelectedLayer.Position)).ToArray());
            }

            _lastPoint = p;
        }