Struct re_renderer::Size
source · #[repr(C)]pub struct Size(pub f32);Expand description
A size of something in either world-units, screen-units, or unsized.
Implementation:
- If positive, this is in scene units.
- If negative, this is in points.
- If NaN, auto-size it.
Resolved on-the-fly in shader code. See shader/utils/size.wgsl
Tuple Fields§
§0: f32Implementations§
source§impl Size
impl Size
sourcepub const AUTO_LARGE: Self = _
pub const AUTO_LARGE: Self = _
Like Size::AUTO, but larger by some small factor (~2).
sourcepub fn new_scene(size: f32) -> Self
pub fn new_scene(size: f32) -> Self
Creates a new size in scene units.
Values passed must be finite positive.
sourcepub fn new_points(size: f32) -> Self
pub fn new_points(size: f32) -> Self
Creates a new size in ui point units.
Values passed must be finite positive.
sourcepub fn is_auto(&self) -> bool
pub fn is_auto(&self) -> bool
Returns true if the size is an automatically determined size (Self::AUTO or Self::AUTO_LARGE).
Trait Implementations§
source§impl<'de> Deserialize<'de> for Size
impl<'de> Deserialize<'de> for Size
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 MulAssign<f32> for Size
impl MulAssign<f32> for Size
source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moresource§impl PartialEq for Size
impl PartialEq for Size
impl Copy for Size
impl Pod for Size
Auto Trait Implementations§
impl RefUnwindSafe for Size
impl Send for Size
impl Sync for Size
impl Unpin for Size
impl UnwindSafe for Size
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
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.