pub enum CoordinateUnit {
Default,
PhysicalPixels,
// some variants omitted
}
Expand description
Indicates the units used to specify spatial event parameters (unless otherwise noted).
Variants§
Default
The physical display is mapped to a coordinate space spanning [-1000, 1000] on both the x and y axes, where positive x extends rightward and positive y extends downward.
Example: (500, -500) in the default coordinate space maps to the center of the top-right quadrant of the physical display.
PhysicalPixels
The physical display is mapped to a coordinate space spanning (0, 0) - (dispaly width, display height), where positive x extends rightward and positive y extends downward.
Test writers should use fuchsia.ui.display.singleton.Info
to retrieve
the physical dimensions of the display.
Note that this space matches both the size AND orientation of the physical display, so it will NOT mirror any rotations applied to the scene graph.
In general, test writers should NOT assume that a particular view’s logical coordinate space matches the physical coordinate space.
Implementations§
Source§impl CoordinateUnit
impl CoordinateUnit
pub fn from_primitive(prim: u32) -> Option<Self>
pub fn from_primitive_allow_unknown(prim: u32) -> Self
pub fn unknown() -> Self
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl Clone for CoordinateUnit
impl Clone for CoordinateUnit
Source§fn clone(&self) -> CoordinateUnit
fn clone(&self) -> CoordinateUnit
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CoordinateUnit
impl Debug for CoordinateUnit
Source§impl<D: ResourceDialect> Decode<CoordinateUnit, D> for CoordinateUnit
impl<D: ResourceDialect> Decode<CoordinateUnit, D> for CoordinateUnit
Source§impl<D: ResourceDialect> Encode<CoordinateUnit, D> for CoordinateUnit
impl<D: ResourceDialect> Encode<CoordinateUnit, D> for CoordinateUnit
Source§impl Hash for CoordinateUnit
impl Hash for CoordinateUnit
Source§impl Ord for CoordinateUnit
impl Ord for CoordinateUnit
Source§fn cmp(&self, other: &CoordinateUnit) -> Ordering
fn cmp(&self, other: &CoordinateUnit) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CoordinateUnit
impl PartialEq for CoordinateUnit
Source§impl PartialOrd for CoordinateUnit
impl PartialOrd for CoordinateUnit
Source§impl TypeMarker for CoordinateUnit
impl TypeMarker for CoordinateUnit
Source§type Owned = CoordinateUnit
type Owned = CoordinateUnit
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for CoordinateUnit
impl ValueTypeMarker for CoordinateUnit
Source§type Borrowed<'a> = CoordinateUnit
type Borrowed<'a> = CoordinateUnit
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for CoordinateUnit
impl Eq for CoordinateUnit
impl StructuralPartialEq for CoordinateUnit
Auto Trait Implementations§
impl Freeze for CoordinateUnit
impl RefUnwindSafe for CoordinateUnit
impl Send for CoordinateUnit
impl Sync for CoordinateUnit
impl Unpin for CoordinateUnit
impl UnwindSafe for CoordinateUnit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)