use js_sys::Array;
use std::fmt::{Debug, Formatter};
use wasm_bindgen::JsCast;
use web_sys::{Event, PointerEvent};
#[derive(Clone)]
pub struct OnClick {
inner: PointerEvent,
}
impl Debug for OnClick {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_str("OnClickEvent")
}
}
impl From<Event> for OnClick {
fn from(e: Event) -> Self {
Self { inner: e.unchecked_into() }
}
}
impl OnClick {
#[inline]
pub fn pointer_id(&self) -> i32 {
self.inner.pointer_id()
}
#[inline]
pub fn width(&self) -> i32 {
self.inner.width()
}
#[inline]
pub fn height(&self) -> i32 {
self.inner.height()
}
#[inline]
pub fn pressure(&self) -> f32 {
self.inner.pressure()
}
#[inline]
pub fn tangential_pressure(&self) -> f32 {
self.inner.tangential_pressure()
}
#[inline]
pub fn tilt_x(&self) -> i32 {
self.inner.tilt_x()
}
#[inline]
pub fn tilt_y(&self) -> i32 {
self.inner.tilt_y()
}
#[inline]
pub fn twist(&self) -> i32 {
self.inner.twist()
}
#[inline]
pub fn pointer_type(&self) -> String {
self.inner.pointer_type()
}
#[inline]
pub fn is_primary(&self) -> bool {
self.inner.is_primary()
}
#[inline]
pub fn get_coalesced_events(&self) -> Array {
self.inner.get_coalesced_events()
}
}