pub struct CoordsMapping { /* private fields */ }
Implementations§
source§impl CoordsMapping
impl CoordsMapping
pub fn new(real_area: Rect) -> Self
pub fn new_scaling(real_area: Rect, scaling: CoordsMappingScaling) -> Self
pub fn scale(&self) -> Vec2
pub fn scalar_scale(&self, max: bool) -> Scalar
pub fn offset(&self) -> Vec2
pub fn virtual_area(&self) -> Rect
pub fn virtual_to_real_vec2(&self, coord: Vec2, local_space: bool) -> Vec2
pub fn real_to_virtual_vec2(&self, coord: Vec2, local_space: bool) -> Vec2
pub fn virtual_to_real_rect(&self, area: Rect, local_space: bool) -> Rect
pub fn real_to_virtual_rect(&self, area: Rect, local_space: bool) -> Rect
Trait Implementations§
source§impl Clone for CoordsMapping
impl Clone for CoordsMapping
source§fn clone(&self) -> CoordsMapping
fn clone(&self) -> CoordsMapping
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 CoordsMapping
impl Debug for CoordsMapping
source§impl Default for CoordsMapping
impl Default for CoordsMapping
source§impl<'de> Deserialize<'de> for CoordsMapping
impl<'de> Deserialize<'de> for CoordsMapping
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 CoordsMapping
impl PartialEq for CoordsMapping
source§impl Serialize for CoordsMapping
impl Serialize for CoordsMapping
impl StructuralPartialEq for CoordsMapping
Auto Trait Implementations§
impl Freeze for CoordsMapping
impl RefUnwindSafe for CoordsMapping
impl Send for CoordsMapping
impl Sync for CoordsMapping
impl Unpin for CoordsMapping
impl UnwindSafe for CoordsMapping
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
)