Struct ViewParameters
pub struct ViewParameters {
pub view: Rectangle,
pub viewport: Rectangle,
pub viewport_to_view_transform: [f32; 9],
}
Expand description
The parameters of the associated view and viewport, sufficient to correctly interpret the position and scale of pointer events dispatched to this view.
Ordering. These parameters arrive over the same channel as pointer events, to provide synchronous context for interpreting the position of pointer events in the view’s local coordinate system.
Inter-protocol redundancy. Some of these parameters may also be sent over an independent channel dedicated to view control; the client is responsible for correct use of asynchronously received parameters.
TODO(https://fxbug.dev/42162292): Rename viewport, it is used in Flatland.
Fields§
§view: Rectangle
The view’s area of content, placed in the coordinate system of the view.
The rectangle is defined by the parent view’s setup of clipping on this view.
viewport: Rectangle
The viewport’s area of interaction, placed in an independent coordinate system.
A pointer event’s position is defined in the coordinate system of this viewport.
A change in viewport extents means the region for pointer interaction has itself moved, or changed in size, or both.
viewport_to_view_transform: [f32; 9]
The transform matrix that relates a point’s position in the viewport’s coordinate system to its position in the view’s coordinate system.
Trait Implementations§
§impl Clone for ViewParameters
impl Clone for ViewParameters
§fn clone(&self) -> ViewParameters
fn clone(&self) -> ViewParameters
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ViewParameters
impl Debug for ViewParameters
§impl<D> Decode<ViewParameters, D> for ViewParameterswhere
D: ResourceDialect,
impl<D> Decode<ViewParameters, D> for ViewParameterswhere
D: ResourceDialect,
§fn new_empty() -> ViewParameters
fn new_empty() -> ViewParameters
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<ViewParameters, D> for &ViewParameterswhere
D: ResourceDialect,
impl<D> Encode<ViewParameters, D> for &ViewParameterswhere
D: ResourceDialect,
§impl PartialEq for ViewParameters
impl PartialEq for ViewParameters
§impl PartialOrd for ViewParameters
impl PartialOrd for ViewParameters
§impl TypeMarker for ViewParameters
impl TypeMarker for ViewParameters
§type Owned = ViewParameters
type Owned = ViewParameters
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§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 more§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.§impl ValueTypeMarker for ViewParameters
impl ValueTypeMarker for ViewParameters
§type Borrowed<'a> = &'a ViewParameters
type Borrowed<'a> = &'a ViewParameters
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<ViewParameters as TypeMarker>::Owned,
) -> <ViewParameters as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<ViewParameters as TypeMarker>::Owned, ) -> <ViewParameters as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.