public void Update() { if (IsMoving) { Rectangle rect = CurrentArea; rect.X += InputManager.MouseVelocity.X; rect.Y += InputManager.MouseVelocity.Y; CurrentArea = rect; } if (IsCreating && !CurrentArea.IsEmpty) { CurrentPosition = InputManager.MousePosition0Based; Point newPosition = CurrentPosition; if (IsProportionalResizing) { newPosition = CaptureHelpers.ProportionalPosition(PositionOnClick, CurrentPosition); } if (IsSnapResizing) { newPosition = SnapPosition(PositionOnClick, newPosition); } CurrentArea = CaptureHelpers.CreateRectangle(PositionOnClick, newPosition); } CheckHover(); ResizeManager.Update(); }
public void Update() { BaseShape shape = CurrentShape; if (shape != null) { if (IsMoving) { ResizeManager.MoveCurrentArea(InputManager.MouseVelocity.X, InputManager.MouseVelocity.Y); } else if (IsCreating && !CurrentRectangle.IsEmpty) { CurrentPosition = InputManager.MousePosition0Based; Point newPosition = CurrentPosition; if (IsProportionalResizing) { newPosition = CaptureHelpers.ProportionalPosition(PositionOnClick, CurrentPosition); } if (IsSnapResizing) { newPosition = SnapPosition(PositionOnClick, newPosition); } shape.EndPosition = newPosition; } } CheckHover(); ResizeManager.Update(); }