예제 #1
0
        private bool isDrawingObject()
        {
            if (!__engaged)
            {
                lineEngaged = new LineEdgePoint();
                lineEngaged.__start.Location = mouseLocation.current;
                lineEngaged.__start.upstream = __snap;
                __engaged = true;
            }
            else
            {
                lineEngaged.__end.Location = mouseLocation.current;
                lineEngaged.__end.upstream = __snap;
                __engaged = false;

                DataModel.ActiveLayer.Add(lineEngaged);
                lineEngaged.draw(__graphics);
                return(true);
            }
            return(false);
        }
예제 #2
0
        private bool isDraggingObject(MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left && __selectedObject != null)
            {
                LineEdgePoint line = __selectedObject as LineEdgePoint;
                SnapBase      p    = __selectedObject as SnapBase;
                if (__selectedObject is LineEdgePoint)
                {
                    Point diff = mouseLocation.current - new Size(mouseLocation.last);
                    line.__start.Location += new Size(diff);
                    line.__end.Location   += new Size(diff);
                }
                else if (__selectedObject is SnapBase && (p.Type == PointType.start || p.Type == PointType.end || p.Type == PointType.center))
                {
                    p.Location = mouseLocation.current;
                }
                return(true);
            }

            return(false);
        }