pub struct Transform2D { /* private fields */ }Expand description
Combined x and y axis transforms for a 2D plotting area.
Implementations§
Source§impl Transform2D
impl Transform2D
Sourcepub const fn new(x: AxisTransform, y: AxisTransform) -> Self
pub const fn new(x: AxisTransform, y: AxisTransform) -> Self
Creates a 2D transform from separate x and y axis transforms.
Sourcepub const fn x(self) -> AxisTransform
pub const fn x(self) -> AxisTransform
Returns the x-axis transform.
Sourcepub const fn y(self) -> AxisTransform
pub const fn y(self) -> AxisTransform
Returns the y-axis transform.
Sourcepub fn data_to_pixel_x(self, x: f64) -> Option<i32>
pub fn data_to_pixel_x(self, x: f64) -> Option<i32>
Converts a data-space x value to a pixel x coordinate.
Sourcepub fn data_to_pixel_y(self, y: f64) -> Option<i32>
pub fn data_to_pixel_y(self, y: f64) -> Option<i32>
Converts a data-space y value to a pixel y coordinate.
Trait Implementations§
Source§impl Clone for Transform2D
impl Clone for Transform2D
Source§fn clone(&self) -> Transform2D
fn clone(&self) -> Transform2D
Returns a duplicate 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 Transform2D
impl Debug for Transform2D
Source§impl PartialEq for Transform2D
impl PartialEq for Transform2D
impl Copy for Transform2D
impl StructuralPartialEq for Transform2D
Auto Trait Implementations§
impl Freeze for Transform2D
impl RefUnwindSafe for Transform2D
impl Send for Transform2D
impl Sync for Transform2D
impl Unpin for Transform2D
impl UnsafeUnpin for Transform2D
impl UnwindSafe for Transform2D
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