pub struct Pad {
pub x: i32,
pub y: i32,
}Expand description
A finger position on the touch pad.
Both x and y are somewhere the range between -1000 and 1000 (both ends included). The 1000 x is on the right, the 1000 y is on the top.
Note that the y coordinate is flipped compared to the screen coordinates. While the display coordinates follow the text reading direction, the touchpad coordinates follow the directions used in geometry.
Fields§
§x: i32§y: i32Implementations§
Source§impl Pad
impl Pad
Sourcepub fn as_dpad4(&self) -> DPad4
pub fn as_dpad4(&self) -> DPad4
Represent the pad values as an 4-directional pad.
Use Pad::as_dpad8 instead if you want to also allow diagonal movement.
Sourcepub fn as_dpad8(&self) -> DPad8
pub fn as_dpad8(&self) -> DPad8
Represent the pad values as an 8-directional pad.
Use Pad::as_dpad4 instead if you don’t want to allow diagonal movement.
Sourcepub fn azimuth(self) -> Angle
pub fn azimuth(self) -> Angle
The angle of the polar coordinate of the touch point.
Trait Implementations§
Source§impl Ord for Pad
impl Ord for Pad
Source§impl PartialOrd for Pad
impl PartialOrd for Pad
impl Copy for Pad
impl Eq for Pad
impl StructuralPartialEq for Pad
Auto Trait Implementations§
impl Freeze for Pad
impl RefUnwindSafe for Pad
impl Send for Pad
impl Sync for Pad
impl Unpin for Pad
impl UnwindSafe for Pad
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more