pub struct ViewConfiguration {
pub logical_constraints: BoxConstraints,
pub physical_constraints: BoxConstraints,
pub device_pixel_ratio: f64,
}Expand description
The layout constraints for the root render object.
Fields§
§logical_constraints: BoxConstraintsThe constraints of the output surface in logical pixels.
physical_constraints: BoxConstraintsThe constraints of the output surface in physical pixels.
device_pixel_ratio: f64The pixel density of the output surface.
Implementations§
Source§impl ViewConfiguration
impl ViewConfiguration
Sourcepub const fn new(
physical_constraints: BoxConstraints,
logical_constraints: BoxConstraints,
device_pixel_ratio: f64,
) -> ViewConfiguration
pub const fn new( physical_constraints: BoxConstraints, logical_constraints: BoxConstraints, device_pixel_ratio: f64, ) -> ViewConfiguration
Creates a view configuration.
By default, the view has zero constraints and a pixel ratio of 1.0.
Sourcepub fn from_view(view: &dyn View) -> ViewConfiguration
pub fn from_view(view: &dyn View) -> ViewConfiguration
Creates a view configuration that matches view.
Sourcepub fn to_matrix(&self) -> Matrix4
pub fn to_matrix(&self) -> Matrix4
Creates a transformation matrix that applies the
device_pixel_ratio.
Sourcepub fn should_update_matrix(
&self,
old_configuration: &ViewConfiguration,
) -> bool
pub fn should_update_matrix( &self, old_configuration: &ViewConfiguration, ) -> bool
Returns whether to_matrix would return a different value for
this configuration than it would for the given old_configuration.
Sourcepub fn to_physical_size(&self, logical_size: Size) -> Size
pub fn to_physical_size(&self, logical_size: Size) -> Size
Transforms the provided logical_size to physical pixels.
Trait Implementations§
Source§impl Clone for ViewConfiguration
impl Clone for ViewConfiguration
impl Copy for ViewConfiguration
Source§impl Debug for ViewConfiguration
impl Debug for ViewConfiguration
Source§impl Default for ViewConfiguration
impl Default for ViewConfiguration
Source§fn default() -> ViewConfiguration
fn default() -> ViewConfiguration
Returns the “default value” for a type. Read more
Source§impl PartialEq for ViewConfiguration
impl PartialEq for ViewConfiguration
impl StructuralPartialEq for ViewConfiguration
Auto Trait Implementations§
impl Freeze for ViewConfiguration
impl RefUnwindSafe for ViewConfiguration
impl Send for ViewConfiguration
impl Sync for ViewConfiguration
impl Unpin for ViewConfiguration
impl UnsafeUnpin for ViewConfiguration
impl UnwindSafe for ViewConfiguration
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