summaryrefslogtreecommitdiffstats
path: root/editor/plugins/animation_state_machine_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/animation_state_machine_editor.cpp')
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index 91ed0bd178..db6e3dd69f 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -337,10 +337,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT && tool_select->is_pressed()) {
box_selecting = true;
box_selecting_from = box_selecting_to = state_machine_draw->get_local_mouse_position();
- box_selecting_rect = Rect2(MIN(box_selecting_from.x, box_selecting_to.x),
- MIN(box_selecting_from.y, box_selecting_to.y),
- ABS(box_selecting_from.x - box_selecting_to.x),
- ABS(box_selecting_from.y - box_selecting_to.y));
+ box_selecting_rect = Rect2(box_selecting_from.min(box_selecting_to), (box_selecting_from - box_selecting_to).abs());
if (mb->is_command_or_control_pressed() || mb->is_shift_pressed()) {
previous_selected = selected_nodes;
@@ -423,10 +420,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
if (mm.is_valid() && box_selecting) {
box_selecting_to = state_machine_draw->get_local_mouse_position();
- box_selecting_rect = Rect2(MIN(box_selecting_from.x, box_selecting_to.x),
- MIN(box_selecting_from.y, box_selecting_to.y),
- ABS(box_selecting_from.x - box_selecting_to.x),
- ABS(box_selecting_from.y - box_selecting_to.y));
+ box_selecting_rect = Rect2(box_selecting_from.min(box_selecting_to), (box_selecting_from - box_selecting_to).abs());
for (int i = 0; i < node_rects.size(); i++) {
bool in_box = node_rects[i].node.intersects(box_selecting_rect);