pub struct Viewport {
pub width: f64,
pub height: f64,
pub major: f64,
pub minor: f64,
pub aspect: f64,
pub landscape: bool,
pub portrait: bool,
pub square: bool,
}Expand description
Struct representing the outermost viewport of a rendering scene, for example a browser window or native application window.
Fields§
§width: f64Viewport width in pixels.
height: f64Viewport height in pixels.
major: f64Larger viewport dimension in pixels.
minor: f64Smaller viewport dimension in pixels.
aspect: f64Width divided by height. Returns 0.0 when height is 0.
landscape: boolTrue when width is greater than height.
portrait: boolTrue when height is greater than width.
square: boolTrue when width and height are effectively equal.
Implementations§
Trait Implementations§
impl Copy for Viewport
Source§impl Interpolatable for Viewport
impl Interpolatable for Viewport
Source§impl ToPaxValue for Viewport
impl ToPaxValue for Viewport
Source§fn to_pax_value(self) -> PaxValue
fn to_pax_value(self) -> PaxValue
Converts this value into a
PaxValue.Source§fn nested_properties(&self) -> Vec<UntypedProperty>
fn nested_properties(&self) -> Vec<UntypedProperty>
Live properties read when snapshotting a compound value for PAXEL.
Adapters observe these as well as the containing property.
Source§fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
Converts against owner-thread graph views, including nested generated
property fields. Requires an entered property graph for shared fields.
Ordinary
Self::to_pax_value reads published value snapshots.Auto Trait Implementations§
impl Freeze for Viewport
impl RefUnwindSafe for Viewport
impl Send for Viewport
impl Sync for Viewport
impl Unpin for Viewport
impl UnsafeUnpin for Viewport
impl UnwindSafe for Viewport
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> PropertyValue for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.