-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add group selection and deletion operations #31
base: main
Are you sure you want to change the base?
Conversation
В целом круто, есть несколько моментов, на которые бы хотелось обратить внимание:
|
public Rect SelectedRect | ||
{ | ||
get => selectedRect; | ||
set => selectedRect = value; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так можно же SelectRect { get; set; }, переопределять геттер и сеттер стоит только если хочется какую-то дополнительную логику добавить
@@ -1,4 +1,5 @@ | |||
using ControlsLibrary.Controls.ErrorReporter; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пустые строчки не нужны
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Большие тернарники на несколько строк лучше оформлять так:
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Гм, как я понял, новый метод явно не нужен. Он же отличается только тем, что ты исправила баг с тем, что вершину можно было удалить при исполнении, так это же и в старом методе нужно было исправить. А новое событие VertexRemoved и там бы не помешало рейзить.
private void zoomControl_PropertyChanged(object sender, PropertyChangedEventArgs e) | ||
{ | ||
zoomControl.TranslateX = initialTranslateX; | ||
zoomControl.TranslateY = initialTranslateY; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо добавить проверку на то, что было изменено интересующее нас свойство 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ага, стоит добавить дабл клик и, наверное, возможность выделения в других режимах. Насчет едита не уверен, но удаление бы точно не помешало. Хотя система с режимами мне не особо нравится, но пока она жива стоит делать ее удобной.
…r change during it. Add classes of custom controls. Refactor
… with MouseUp event handling on zoomArea
No description provided.