diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-17 20:48:50 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-17 20:48:50 +0100 |
commit | 7c76d1743d5b0c3cf6eb05076fae88e948f3e22f (patch) | |
tree | 247d7739d7113cd0319d7b2949940abedc0be14b /src/crepe/system/InputSystem.cpp | |
parent | a3e418c1a48a057d82fc3faf927ebf1cd3da7227 (diff) |
make format
Diffstat (limited to 'src/crepe/system/InputSystem.cpp')
-rw-r--r-- | src/crepe/system/InputSystem.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/crepe/system/InputSystem.cpp b/src/crepe/system/InputSystem.cpp index 34aad06..60daa55 100644 --- a/src/crepe/system/InputSystem.cpp +++ b/src/crepe/system/InputSystem.cpp @@ -158,8 +158,10 @@ void InputSystem::handle_move(const EventData & event_data, const vec2 & mouse_p for (Button & button : buttons) { if (!button.active) continue; - Metadata & metadata = mgr.get_components_by_id<Metadata>(button.game_object_id).front(); - Transform & transform = mgr.get_components_by_id<Transform>(button.game_object_id).front(); + Metadata & metadata + = mgr.get_components_by_id<Metadata>(button.game_object_id).front(); + Transform & transform + = mgr.get_components_by_id<Transform>(button.game_object_id).front(); bool was_hovering = button.hover; if (this->is_mouse_inside_button(mouse_pos, button, transform)) { button.hover = true; @@ -182,8 +184,10 @@ void InputSystem::handle_click(const MouseButton & mouse_button, const vec2 & mo for (Button & button : buttons) { if (!button.active) continue; - Metadata & metadata = mgr.get_components_by_id<Metadata>(button.game_object_id).front(); - Transform & transform = mgr.get_components_by_id<Transform>(button.game_object_id).front(); + Metadata & metadata + = mgr.get_components_by_id<Metadata>(button.game_object_id).front(); + Transform & transform + = mgr.get_components_by_id<Transform>(button.game_object_id).front(); if (this->is_mouse_inside_button(mouse_pos, button, transform)) { event_mgr.trigger_event<ButtonPressEvent>(metadata); |