pub struct RangedCoord<X: Ranged, Y: Ranged> { /* private fields */ }Expand description
The coordinate described by two ranged value
Implementations§
Source§impl<X: Ranged, Y: Ranged> RangedCoord<X, Y>
impl<X: Ranged, Y: Ranged> RangedCoord<X, Y>
Sourcepub fn new<IntoX: Into<X>, IntoY: Into<Y>>(
logic_x: IntoX,
logic_y: IntoY,
actual: (Range<i32>, Range<i32>),
) -> Self
pub fn new<IntoX: Into<X>, IntoY: Into<Y>>( logic_x: IntoX, logic_y: IntoY, actual: (Range<i32>, Range<i32>), ) -> Self
Create a new ranged value coordinate system
Sourcepub fn draw_mesh<E, DrawMesh: FnMut(MeshLine<'_, X, Y>) -> Result<(), E>>(
&self,
h_limit: usize,
v_limit: usize,
draw_mesh: DrawMesh,
) -> Result<(), E>
pub fn draw_mesh<E, DrawMesh: FnMut(MeshLine<'_, X, Y>) -> Result<(), E>>( &self, h_limit: usize, v_limit: usize, draw_mesh: DrawMesh, ) -> Result<(), E>
Draw the mesh for the coordinate system
Sourcepub fn get_x_range(&self) -> Range<X::ValueType>
pub fn get_x_range(&self) -> Range<X::ValueType>
Get the range of X axis
Sourcepub fn get_y_range(&self) -> Range<Y::ValueType>
pub fn get_y_range(&self) -> Range<Y::ValueType>
Get the range of Y axis
Trait Implementations§
Source§impl<X: Ranged, Y: Ranged> CoordTranslate for RangedCoord<X, Y>
impl<X: Ranged, Y: Ranged> CoordTranslate for RangedCoord<X, Y>
Source§impl<X: ReversableRanged, Y: ReversableRanged> ReverseCoordTranslate for RangedCoord<X, Y>
impl<X: ReversableRanged, Y: ReversableRanged> ReverseCoordTranslate for RangedCoord<X, Y>
Source§fn reverse_translate(&self, input: BackendCoord) -> Option<Self::From>
fn reverse_translate(&self, input: BackendCoord) -> Option<Self::From>
Reverse translate the coordinate from the drawing coordinate to the
logic coordinate.
Note: the return value is an option, because it’s possible that the drawing
coordinate isn’t able to be represented in te guest cooredinate system
Auto Trait Implementations§
impl<X, Y> Freeze for RangedCoord<X, Y>
impl<X, Y> RefUnwindSafe for RangedCoord<X, Y>where
X: RefUnwindSafe,
Y: RefUnwindSafe,
impl<X, Y> Send for RangedCoord<X, Y>
impl<X, Y> Sync for RangedCoord<X, Y>
impl<X, Y> Unpin for RangedCoord<X, Y>
impl<X, Y> UnwindSafe for RangedCoord<X, Y>where
X: UnwindSafe,
Y: UnwindSafe,
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> 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