/// <summary> /// Clears the canvas. /// </summary> public void ClearCanvas() { _currentSelectedShapeShapeDrawer = null; _canvasDrawer.NotifyCurrentShapeChanged(); _canvasDrawer.ClearShapeDrawersManager(); _canvasDrawer.NotifyCanvasRefreshDrawRequested(); }
public void TestNotifyCurrentShapeChanged() { int count = 0; _canvasDrawer.CurrentShapeChanged += () => count++; _canvasDrawer.NotifyCurrentShapeChanged(); Assert.AreEqual(count, 1); _canvasDrawer.NotifyCurrentShapeChanged(); Assert.AreEqual(count, 2); }
/// <summary> /// Handles the canvas left mouse released. /// </summary> public void HandleCanvasLeftMouseReleased(Point mousePosition) { _canvasDrawer.CreateThenExecuteResizingCommand(_currentResizingShapeShapeDrawer, _currentResizingShapeOldDrawingEndingPoint, _currentResizingShapeShapeDrawer.DrawingEndingPoint); _canvasDrawer.SetCurrentState(new CanvasDrawerPointerState(_canvasDrawer)); _canvasDrawer.NotifyCurrentShapeChanged(); // Only notify after `CanvasDrawerPointerState` is completely created. }
/// <summary> /// Handles the canvas left mouse released. /// </summary> public void HandleCanvasLeftMouseReleased(Point mousePosition) { EndDrawing(mousePosition); _canvasDrawer.SetCurrentState(new CanvasDrawerPointerState(_canvasDrawer)); _canvasDrawer.NotifyCurrentShapeChanged(); // Only notify after `CanvasDrawerPointerState` is completely created. }