port forward scrolling fix

macos-click-through
Keith Simmons 4 years ago
parent 1f699afad1
commit 3449cfda7a

@ -119,7 +119,7 @@ pub struct RenderedWindow {
scroll_t: f32,
}
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct WindowDrawDetails {
pub id: u64,
pub region: Rect,

@ -18,6 +18,8 @@ use glutin::{
use crate::channel_utils::LoggingTx;
use crate::bridge::UiCommand;
use crate::renderer::{Renderer, WindowDrawDetails};
use crate::settings::SETTINGS;
use crate::window::WindowSettings;
pub struct MouseManager {
command_sender: LoggingTx<UiCommand>,
@ -148,9 +150,11 @@ impl MouseManager {
return;
}
let scroll_dead_zone = SETTINGS.get::<WindowSettings>().scroll_dead_zone;
let vertical_input_type = match y {
_ if y > 1.8 => Some("up"),
_ if y < -1.8 => Some("down"),
_ if y > scroll_dead_zone => Some("up"),
_ if y < -scroll_dead_zone => Some("down"),
_ => None,
};
@ -165,8 +169,8 @@ impl MouseManager {
}
let horizontal_input_type = match x {
_ if x > 1.8 => Some("right"),
_ if x < -1.8 => Some("left"),
_ if x > scroll_dead_zone => Some("right"),
_ if x < -scroll_dead_zone => Some("left"),
_ => None,
};

Loading…
Cancel
Save