mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-11 02:37:00 +00:00
Consolidate redundant variables
This commit is contained in:
parent
8d850bef54
commit
73476e5541
@ -91,8 +91,8 @@ impl Viewer {
|
|||||||
y: -(y / height * 2. - 1.) / aspect_ratio,
|
y: -(y / height * 2. - 1.) / aspect_ratio,
|
||||||
};
|
};
|
||||||
|
|
||||||
if let (Some(cursor_old), Some(button)) =
|
if let (Some(cursor_old), Some(button), Some(focus_point)) =
|
||||||
(self.cursor, self.most_recent_mouse_button)
|
(self.cursor, self.most_recent_mouse_button, self.focus_point)
|
||||||
{
|
{
|
||||||
match button {
|
match button {
|
||||||
MouseButton::Left => {
|
MouseButton::Left => {
|
||||||
@ -103,16 +103,9 @@ impl Viewer {
|
|||||||
let angle_y =
|
let angle_y =
|
||||||
diff_x * self.camera_tuning_config.rotation_sensitivity;
|
diff_x * self.camera_tuning_config.rotation_sensitivity;
|
||||||
|
|
||||||
if let Some(focus_point) = self.focus_point {
|
self.camera.apply_rotation(angle_x, angle_y, focus_point);
|
||||||
self.camera.apply_rotation(
|
|
||||||
angle_x,
|
|
||||||
angle_y,
|
|
||||||
focus_point,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
MouseButton::Right => {
|
MouseButton::Right => {
|
||||||
if let Some(focus_point) = self.focus_point {
|
|
||||||
self.camera.apply_translation(
|
self.camera.apply_translation(
|
||||||
cursor_old,
|
cursor_old,
|
||||||
cursor_new,
|
cursor_new,
|
||||||
@ -121,7 +114,6 @@ impl Viewer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
self.cursor = Some(cursor_new);
|
self.cursor = Some(cursor_new);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user