Exemple #1
0
		private bool PerformQuickRotate(IDiagramPresenter diagramPresenter, int angle) {
			bool result = false;
			if (enableQuickRotate) {
				ICommand cmd = new RotateShapesCommand(diagramPresenter.SelectedShapes, angle);
				diagramPresenter.Project.ExecuteCommand(cmd);
				InvalidateAnglePreview(diagramPresenter);
				result = true;
			}
			return result;
		}
Exemple #2
0
		// apply rotate action
		private bool PerformRotate(IDiagramPresenter diagramPresenter) {
			bool result = false;
			if (PendingToolActionsCount >= 1
				&& ActionStartMouseState.Position != CurrentMouseState.Position
				&& IsMinRotateRangeExceeded(ActionDiagramPresenter, CurrentMouseState)) {
				// Calculate rotation
				MouseState initMouseState = GetPreviousMouseState();
				int startAngle, sweepAngle;
				CalcAngle(initMouseState, ActionStartMouseState, CurrentMouseState, out startAngle, out sweepAngle);
				// Create and execute command
				ICommand cmd = new RotateShapesCommand(diagramPresenter.SelectedShapes, sweepAngle);
				diagramPresenter.Project.ExecuteCommand(cmd);
				result = true;
			}
			return result;
		}