Add group selection and deletion operations - #31
Conversation
|
В целом круто, есть несколько моментов, на которые бы хотелось обратить внимание:
|
| public Rect SelectedRect | ||
| { | ||
| get => selectedRect; | ||
| set => selectedRect = value; | ||
| } |
There was a problem hiding this comment.
Так можно же SelectRect { get; set; }, переопределять геттер и сеттер стоит только если хочется какую-то дополнительную логику добавить
| @@ -1,4 +1,5 @@ | |||
| using ControlsLibrary.Controls.ErrorReporter; | |||
| | |||
There was a problem hiding this comment.
Пустые строчки не нужны
| x = mouseDownPosition.X < mouseCurrentPosition.X ? | ||
| mouseDownPosition.X : mouseCurrentPosition.X; | ||
| y = mouseDownPosition.Y < mouseCurrentPosition.Y ? | ||
| mouseDownPosition.Y : mouseCurrentPosition.Y; |
There was a problem hiding this comment.
Большие тернарники на несколько строк лучше оформлять так:
| x = mouseDownPosition.X < mouseCurrentPosition.X ? | |
| mouseDownPosition.X : mouseCurrentPosition.X; | |
| y = mouseDownPosition.Y < mouseCurrentPosition.Y ? | |
| mouseDownPosition.Y : mouseCurrentPosition.Y; | |
| x = mouseDownPosition.X < mouseCurrentPosition.X | |
| ? mouseDownPosition.X | |
| : mouseCurrentPosition.X; | |
| y = mouseDownPosition.Y < mouseCurrentPosition.Y | |
| ? mouseDownPosition.Y | |
| : mouseCurrentPosition.Y; |
| private void SafeRemoveVertex(VertexControl vc) | ||
| private void TrySafeRemoveVertex(VertexControl vc) | ||
| { | ||
| if (ExecutorViewModel.InSimulation) | ||
| { | ||
| return; | ||
| } | ||
| SafeRemoveVertex(vc); | ||
| VertexRemoved?.Invoke(this, new VertexRemovedEventArgs() { VertexControl = vc }); | ||
| } |
There was a problem hiding this comment.
Гм, как я понял, новый метод явно не нужен. Он же отличается только тем, что ты исправила баг с тем, что вершину можно было удалить при исполнении, так это же и в старом методе нужно было исправить. А новое событие VertexRemoved и там бы не помешало рейзить.
| private void zoomControl_PropertyChanged(object sender, PropertyChangedEventArgs e) | ||
| { | ||
| zoomControl.TranslateX = initialTranslateX; | ||
| zoomControl.TranslateY = initialTranslateY; | ||
| } |
There was a problem hiding this comment.
Надо добавить проверку на то, что было изменено интересующее нас свойство Presenter или как оно там называется
| else if (e.RightButton == MouseButtonState.Pressed) | ||
| { | ||
| if (Toolbar.SelectedTool == SelectedTool.Select) | ||
| { | ||
| if (selectedArea != null) | ||
| { | ||
| ClearSelectedArea(); | ||
| } | ||
| ClearSelectMode(true); | ||
| SelectionStarted?.Invoke(this, e); |
There was a problem hiding this comment.
Ага, стоит добавить дабл клик и, наверное, возможность выделения в других режимах. Насчет едита не уверен, но удаление бы точно не помешало. Хотя система с режимами мне не особо нравится, но пока она жива стоит делать ее удобной.
…r change during it. Add classes of custom controls. Refactor
… with MouseUp event handling on zoomArea
No description provided.