public Reposition(DragInfo dragInfo, MouseEvt me, bool axisLock) { double tx = me.Pt.X - dragInfo.Me.Pt.X; double ty = me.Pt.Y - dragInfo.Me.Pt.Y; if (axisLock) { if (Math.Abs(tx) < Math.Abs(ty)) { tx = 0; } else { ty = 0; } } this.output = new Lazy<Tuple<Polygon, Point>>(() => Tuple.Create(dragInfo.Me.Element.Polygon, new Point(dragInfo.OriginalLeft + tx, dragInfo.OriginalTop + ty))); }
public Reposition(DragInfo dragInfo, MouseEvt me, bool axisLock) { double tx = me.Pt.X - dragInfo.Me.Pt.X; double ty = me.Pt.Y - dragInfo.Me.Pt.Y; if (axisLock) { if (Math.Abs(tx) < Math.Abs(ty)) { tx = 0; } else { ty = 0; } } this.output = new Lazy <Tuple <Polygon, Point> >(() => Tuple.Create(dragInfo.Me.Element.Polygon, new Point(dragInfo.OriginalLeft + tx, dragInfo.OriginalTop + ty))); }