Struct webrender::util::ScaleOffset
source · #[repr(C)]pub struct ScaleOffset {
pub scale: Vector2D<f32, UnknownUnit>,
pub offset: Vector2D<f32, UnknownUnit>,
}
Fields§
§scale: Vector2D<f32, UnknownUnit>
§offset: Vector2D<f32, UnknownUnit>
Implementations§
source§impl ScaleOffset
impl ScaleOffset
pub fn new(sx: f32, sy: f32, tx: f32, ty: f32) -> Self
pub fn identity() -> Self
pub fn from_transform<F, T>(m: &Transform3D<f32, F, T>) -> Option<ScaleOffset>
pub fn from_offset(offset: Vector2D<f32>) -> Self
pub fn from_scale(scale: Vector2D<f32>) -> Self
pub fn inverse(&self) -> Self
pub fn pre_offset(&self, offset: Vector2D<f32>) -> Self
pub fn pre_scale(&self, scale: f32) -> Self
pub fn then_scale(&self, scale: f32) -> Self
sourcepub fn pre_transform(&self, other: &ScaleOffset) -> Self
pub fn pre_transform(&self, other: &ScaleOffset) -> Self
Produce a ScaleOffset that includes both self and other.
The ‘self’ ScaleOffset is applied after other
.
This is equivalent to Transform3D::pre_transform
.
sourcepub fn then(&self, other: &ScaleOffset) -> Self
pub fn then(&self, other: &ScaleOffset) -> Self
Produce a ScaleOffset that includes both self and other.
The ‘other’ ScaleOffset is applied after self
.
This is equivalent to Transform3D::then
.
pub fn map_rect<F, T>(&self, rect: &Box2D<f32, F>) -> Box2D<f32, T>
pub fn unmap_rect<F, T>(&self, rect: &Box2D<f32, F>) -> Box2D<f32, T>
pub fn map_vector<F, T>(&self, vector: &Vector2D<f32, F>) -> Vector2D<f32, T>
pub fn map_size<F, T>(&self, size: &Size2D<f32, F>) -> Size2D<f32, T>
pub fn unmap_vector<F, T>(&self, vector: &Vector2D<f32, F>) -> Vector2D<f32, T>
pub fn map_point<F, T>(&self, point: &Point2D<f32, F>) -> Point2D<f32, T>
pub fn unmap_point<F, T>(&self, point: &Point2D<f32, F>) -> Point2D<f32, T>
pub fn to_transform<F, T>(&self) -> Transform3D<f32, F, T>
Trait Implementations§
source§impl Clone for ScaleOffset
impl Clone for ScaleOffset
source§fn clone(&self) -> ScaleOffset
fn clone(&self) -> ScaleOffset
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 ScaleOffset
impl Debug for ScaleOffset
source§impl From<ScaleOffset> for CompositorTransform
impl From<ScaleOffset> for CompositorTransform
source§fn from(scale_offset: ScaleOffset) -> Self
fn from(scale_offset: ScaleOffset) -> Self
Converts to this type from the input type.
source§impl Into<GpuBufferBlockF> for ScaleOffset
impl Into<GpuBufferBlockF> for ScaleOffset
source§fn into(self) -> GpuBufferBlockF
fn into(self) -> GpuBufferBlockF
Converts this type into the (usually inferred) input type.
source§impl MallocSizeOf for ScaleOffset
impl MallocSizeOf for ScaleOffset
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl PartialEq for ScaleOffset
impl PartialEq for ScaleOffset
source§impl Serialize for ScaleOffset
impl Serialize for ScaleOffset
impl Copy for ScaleOffset
impl StructuralPartialEq for ScaleOffset
Auto Trait Implementations§
impl Freeze for ScaleOffset
impl RefUnwindSafe for ScaleOffset
impl Send for ScaleOffset
impl Sync for ScaleOffset
impl Unpin for ScaleOffset
impl UnwindSafe for ScaleOffset
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more