mirror of
https://github.com/hannobraun/Fornjot
synced 2025-07-20 17:06:07 +00:00
Simplify
This commit is contained in:
parent
117233d0b7
commit
0aab9be11a
@ -89,7 +89,7 @@ impl ApplicationHandler for DisplayState {
|
|||||||
&event,
|
&event,
|
||||||
window,
|
window,
|
||||||
&self.held_mouse_button,
|
&self.held_mouse_button,
|
||||||
viewer.cursor(),
|
*viewer.cursor(),
|
||||||
self.invert_zoom,
|
self.invert_zoom,
|
||||||
);
|
);
|
||||||
if let Some(input_event) = input_event {
|
if let Some(input_event) = input_event {
|
||||||
@ -157,7 +157,7 @@ fn input_event(
|
|||||||
event: &WindowEvent,
|
event: &WindowEvent,
|
||||||
window: &Window,
|
window: &Window,
|
||||||
held_mouse_button: &Option<MouseButton>,
|
held_mouse_button: &Option<MouseButton>,
|
||||||
previous_cursor: &mut Option<NormalizedScreenPosition>,
|
previous_cursor: Option<NormalizedScreenPosition>,
|
||||||
invert_zoom: bool,
|
invert_zoom: bool,
|
||||||
) -> Option<InputEvent> {
|
) -> Option<InputEvent> {
|
||||||
match event {
|
match event {
|
||||||
@ -171,7 +171,7 @@ fn input_event(
|
|||||||
x: position.x / width * 2. - 1.,
|
x: position.x / width * 2. - 1.,
|
||||||
y: -(position.y / height * 2. - 1.) / aspect_ratio,
|
y: -(position.y / height * 2. - 1.) / aspect_ratio,
|
||||||
};
|
};
|
||||||
match (*previous_cursor, held_mouse_button) {
|
match (previous_cursor, held_mouse_button) {
|
||||||
(Some(previous), Some(button)) => match button {
|
(Some(previous), Some(button)) => match button {
|
||||||
MouseButton::Left => {
|
MouseButton::Left => {
|
||||||
let diff_x = current.x - previous.x;
|
let diff_x = current.x - previous.x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user