示例#1
0
        public void GestureComplete(IPointerEvent evnt)
        {
            Location loc1 = Constants.SnapToGrid(new Location(evnt.X, evnt.Y));

            if (loc0 != loc1)
            {
                WireSegment[] proposedSegs = GetSegments(loc0, loc1, evnt.IsModified(GestureModifier.Alt));
                // Console.WriteLine("**** Adding Wire ****");
                layoutModel.Execute((ILayoutAccess lo) => {
                    foreach (WireSegment seg in proposedSegs)
                    {
                        AddWireSegment(lo, layoutModel.WiringPoints, seg);
                        layoutModel.WiringPoints.Update();
                    }
                });
            }
            layoutModel.Gesture = null;
            evnt.RepaintCanvas();
        }
示例#2
0
        public void GestureMove(IPointerEvent evnt)
        {
            Location pt  = Constants.SnapToGrid(new Location(evnt.X, evnt.Y));
            bool     mod = evnt.IsModified(GestureModifier.Alt);

            if (pt != loc1 || mod != isModified)
            {
                loc1       = pt;
                isModified = mod;
                if (loc0.X == loc1.X)
                {
                    horzFirst = false;
                }
                else if (loc0.Y == loc1.Y)
                {
                    horzFirst = true;
                }
                evnt.RepaintCanvas();
            }
        }
示例#3
0
 public bool IsModified(GestureModifier query)
 {
     return(master.IsModified(query));
 }