private FreePoint compareFreePoints(RootFigureList figureList, FreePoint aPoint) { foreach (IFigure aFigure in figureList) if (aFigure is FreePoint && Math.Abs((aFigure as FreePoint).X - aPoint.X)<_delta && Math.Abs((aFigure as FreePoint).Y - aPoint.Y)<_delta) return aFigure as FreePoint; return null; }
private FreePoint compareFreePoints(RootFigureList figureList, FreePoint aPoint) { foreach (IFigure aFigure in figureList) { if (aFigure is FreePoint && Math.Abs((aFigure as FreePoint).X - aPoint.X) < _delta && Math.Abs((aFigure as FreePoint).Y - aPoint.Y) < _delta) { return(aFigure as FreePoint); } } return(null); }
public Drawing(Canvas canvas) { Check.NotNull(canvas, "canvas"); ActionManager = new ActionManager(); StyleManager = new StyleManager(this); Figures = new RootFigureList(this); OnAttachToCanvas += Drawing_OnAttachToCanvas; OnDetachFromCanvas += Drawing_OnDetachFromCanvas; Canvas = canvas; CoordinateSystem = new CoordinateSystem(this); CoordinateGrid = new CartesianGrid() { Drawing = this, Visible = Settings.Instance.ShowGrid }; Figures.Add(CoordinateGrid); Version = Settings.CurrentDrawingVersion; }