pub struct LogicalWindowSize {
pub width: f64,
pub height: f64,
}Expand description
Window inner size in logical pixels.
Self::new floors ordinary finite components, NaN, and negative infinity
at 1.0; positive infinity remains infinite. Public fields and derived
deserialization can represent values that bypass that normalization.
§Examples
use ailloli_ui_app_storage::LogicalWindowSize;
assert_eq!(LogicalWindowSize::new(0.0, 480.0), LogicalWindowSize { width: 1.0, height: 480.0 });Fields§
§width: f64Inner width in logical pixels.
height: f64Inner height in logical pixels.
Implementations§
Source§impl LogicalWindowSize
impl LogicalWindowSize
Sourcepub fn new(width: f64, height: f64) -> Self
pub fn new(width: f64, height: f64) -> Self
Creates a size with each component floored at one logical pixel.
Floating-point max maps NaN and negative infinity to 1.0, while
positive infinity remains infinite.
§Examples
use ailloli_ui_app_storage::LogicalWindowSize;
assert_eq!(LogicalWindowSize::new(-10.0, f64::NAN), LogicalWindowSize::new(1.0, 1.0));Trait Implementations§
Source§impl Clone for LogicalWindowSize
impl Clone for LogicalWindowSize
Source§fn clone(&self) -> LogicalWindowSize
fn clone(&self) -> LogicalWindowSize
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogicalWindowSize
impl Debug for LogicalWindowSize
Source§impl<'de> Deserialize<'de> for LogicalWindowSize
impl<'de> Deserialize<'de> for LogicalWindowSize
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for LogicalWindowSize
impl PartialEq for LogicalWindowSize
Source§impl Serialize for LogicalWindowSize
impl Serialize for LogicalWindowSize
impl Copy for LogicalWindowSize
impl StructuralPartialEq for LogicalWindowSize
Auto Trait Implementations§
impl Freeze for LogicalWindowSize
impl RefUnwindSafe for LogicalWindowSize
impl Send for LogicalWindowSize
impl Sync for LogicalWindowSize
impl Unpin for LogicalWindowSize
impl UnwindSafe for LogicalWindowSize
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