/// <summary> /// Left nouse button is pressed /// </summary> /// <param name="drawArea"> </param> /// <param name="e"> </param> public override void OnMouseDown(TransparentCanvas drawArea, MouseEventArgs e) { // Create new polygon, add it to the list // and keep reference to it _newPolygon = new DrawPolygon(e.X, e.Y, e.X + 1, e.Y + 1); AddNewObject(drawArea, _newPolygon); _lastX = e.X; _lastY = e.Y; }
/// <summary> /// Clone this instance /// </summary> public override DrawObject Clone() { var drawPolygon = new DrawPolygon(); foreach (Point p in _pointArray) { drawPolygon._pointArray.Add(p); } FillDrawObjectFields(drawPolygon); return drawPolygon; }
/// <summary> /// Clone this instance /// </summary> public override DrawObject Clone() { var drawPolygon = new DrawPolygon(); foreach (Point p in _pointArray) { drawPolygon._pointArray.Add(p); } FillDrawObjectFields(drawPolygon); return(drawPolygon); }
public override void OnMouseUp(TransparentCanvas drawArea, MouseEventArgs e) { _newPolygon = null; base.OnMouseUp(drawArea, e); }