Struct firefly_rust::graphics::Size
source · pub struct Size {
pub width: i32,
pub height: i32,
}
Expand description
Size of a bounding box for a shape.
The width and height must be positive.
Fields§
§width: i32
§height: i32
Implementations§
source§impl Size
impl Size
pub fn new<I: Into<i32>>(width: I, height: I) -> Self
sourcepub fn component_min(self, other: Self) -> Self
pub fn component_min(self, other: Self) -> Self
Set both width and height to their minimum in the two given points.
sourcepub fn component_max(self, other: Self) -> Self
pub fn component_max(self, other: Self) -> Self
Set both width and height to their maximum in the two given points.
Trait Implementations§
source§impl AddAssign<Size> for Point
impl AddAssign<Size> for Point
source§fn add_assign(&mut self, other: Size)
fn add_assign(&mut self, other: Size)
Performs the
+=
operation. Read moresource§impl AddAssign for Size
impl AddAssign for Size
source§fn add_assign(&mut self, other: Size)
fn add_assign(&mut self, other: Size)
Performs the
+=
operation. Read moresource§impl DivAssign<i32> for Size
impl DivAssign<i32> for Size
source§fn div_assign(&mut self, rhs: i32)
fn div_assign(&mut self, rhs: i32)
Performs the
/=
operation. Read moresource§impl MulAssign<i32> for Size
impl MulAssign<i32> for Size
source§fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
Performs the
*=
operation. Read moresource§impl Ord for Size
impl Ord for Size
source§impl PartialEq for Size
impl PartialEq for Size
source§impl PartialOrd for Size
impl PartialOrd for Size
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl SubAssign<Size> for Point
impl SubAssign<Size> for Point
source§fn sub_assign(&mut self, other: Size)
fn sub_assign(&mut self, other: Size)
Performs the
-=
operation. Read moresource§impl SubAssign for Size
impl SubAssign for Size
source§fn sub_assign(&mut self, other: Size)
fn sub_assign(&mut self, other: Size)
Performs the
-=
operation. Read moreimpl Copy for Size
impl Eq for Size
impl StructuralPartialEq for Size
Auto Trait Implementations§
impl Freeze for Size
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.