mirror of
https://github.com/hannobraun/Fornjot
synced 2025-09-06 01:16:42 +00:00
Simplify
This commit is contained in:
parent
fde836bc7d
commit
c12e7dfd5e
@ -1,4 +1,4 @@
|
||||
use super::{movement::Movement, rotation::Rotation, zoom::Zoom, InputEvent};
|
||||
use super::{movement, rotation::Rotation, zoom::Zoom, InputEvent};
|
||||
use crate::camera::{Camera, FocusPoint};
|
||||
|
||||
/// Input handling abstraction
|
||||
@ -16,7 +16,7 @@ impl InputHandler {
|
||||
) {
|
||||
match event {
|
||||
InputEvent::Translation { previous, current } => {
|
||||
Movement::apply(previous, current, focus_point, camera);
|
||||
movement::apply(previous, current, focus_point, camera);
|
||||
}
|
||||
InputEvent::Rotation { angle_x, angle_y } => {
|
||||
Rotation::apply(angle_x, angle_y, focus_point, camera);
|
||||
|
@ -5,15 +5,12 @@ use crate::{
|
||||
screen::NormalizedScreenPosition,
|
||||
};
|
||||
|
||||
pub struct Movement;
|
||||
|
||||
impl Movement {
|
||||
pub fn apply(
|
||||
pub fn apply(
|
||||
previous: NormalizedScreenPosition,
|
||||
current: NormalizedScreenPosition,
|
||||
focus_point: FocusPoint,
|
||||
camera: &mut Camera,
|
||||
) {
|
||||
) {
|
||||
let previous = camera.cursor_to_model_space(previous);
|
||||
let cursor = camera.cursor_to_model_space(current);
|
||||
|
||||
@ -29,5 +26,4 @@ impl Movement {
|
||||
offset.y,
|
||||
Scalar::ZERO,
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user