formatting and clippy fixes

macos-click-through
Keith Simmons 3 years ago committed by Keith Simmons
parent 46845b86b4
commit 8bade3667d

@ -121,7 +121,11 @@ impl GlutinWindowWrapper {
pub fn handle_event(&mut self, event: Event<()>, running: &Arc<AtomicBool>) {
self.keyboard_manager.handle_event(&event);
self.mouse_manager.handle_event(
&event, &self.keyboard_manager, &self.renderer, &self.windowed_context);
&event,
&self.keyboard_manager,
&self.renderer,
&self.windowed_context,
);
match event {
Event::LoopDestroyed => {
self.handle_quit(running);

@ -8,10 +8,10 @@ use glutin::{
};
use skia_safe::Rect;
use super::keyboard_manager::KeyboardManager;
use crate::bridge::UiCommand;
use crate::channel_utils::LoggingTx;
use crate::renderer::{Renderer, WindowDrawDetails};
use super::keyboard_manager::KeyboardManager;
fn clamp_position(
position: PhysicalPosition<f32>,
@ -178,7 +178,12 @@ impl MouseManager {
}
}
fn handle_pointer_transition(&mut self, mouse_button: &MouseButton, down: bool, keyboard_manager: &KeyboardManager) {
fn handle_pointer_transition(
&mut self,
mouse_button: &MouseButton,
down: bool,
keyboard_manager: &KeyboardManager,
) {
// For some reason pointer down is handled differently from pointer up and drag.
// Floating windows: relative coordinates are great.
// Non floating windows: rather than global coordinates, relative are needed
@ -210,7 +215,7 @@ impl MouseManager {
self.dragging = Some(button_text);
if !self.dragging.is_some() {
if self.dragging.is_none() {
self.has_moved = false;
}
}
@ -284,7 +289,8 @@ impl MouseManager {
self.handle_line_scroll(
pixel_x / font_width as f32,
pixel_y / font_height as f32,
keyboard_manager);
keyboard_manager,
);
}
pub fn handle_event(
@ -331,7 +337,8 @@ impl MouseManager {
} => self.handle_pointer_transition(
button,
state == &ElementState::Pressed,
keyboard_manager),
keyboard_manager,
),
_ => {}
}
}

Loading…
Cancel
Save