use crate::geometry::Point;
use winit::dpi::PhysicalPosition;
use winit::event::{ButtonSource, DeviceId, ElementState};
#[derive(Clone, Copy, Debug)]
pub struct PointerButton {
pub device_id: Option<DeviceId>,
pub state: ElementState,
pub position: Point,
pub button: ButtonSource,
pub primary: bool,
}
impl PointerButton {
pub fn new(
device_id: Option<DeviceId>,
state: ElementState,
position: PhysicalPosition<f64>,
button: ButtonSource,
primary: bool,
) -> Self {
Self {
device_id,
state,
position: position.into(),
button,
primary,
}
}
}