public void Execute() { GenericShape newForm = shapeContainer.shapes[newShapeIndex]; double width = Math.Abs(newForm.position.X - posX); double height = Math.Abs(newForm.position.Y - posY); rectangle = new RectangleShape(newForm.position.X - 5, newForm.position.Y - 5, width, height, newShapeIndex, brush); }
public void Execute() { GenericShape newForm = new GenericShape(); rectangle = new RectangleShape(posX, posY, 0, 0, newShapeIndex, brush); newForm.Shape = rectangle.Shape; newForm.position = new Point(posX, posY); newForm.ShapeTyp = GenericShape.type.Rectangle; shapeContainer.shapes.Add(newShapeIndex, newForm); }
public void Execute() { Geometry geomerty = HitResult.Data; RectangleGeometry currentShape = geomerty as RectangleGeometry; GenericShape form = shapeContainer.shapes[newShapeIndex]; double width = currentShape.Rect.Width; double height = currentShape.Rect.Height; rectangle = new RectangleShape(form.position.X, form.position.Y, width + dX, height + dX, newShapeIndex, brush); form.Shape = rectangle.Shape; form.position = new Point(form.position.X, form.position.Y); shapeContainer.UpdateShape(form, newShapeIndex); }