pub struct Point<T> {
pub x: T,
pub y: T,
}
Expand description
A 2-dimensional coordinate.
When used in association with a Rect
, represents the top-left corner.
Fields§
§x: T
The x-coordinate
y: T
The y-coordinate
Implementations§
Source§impl<T> Point<T>
impl<T> Point<T>
Sourcepub fn map<R, F>(self, f: F) -> Point<R>where
F: Fn(T) -> R,
pub fn map<R, F>(self, f: F) -> Point<R>where
F: Fn(T) -> R,
Applies the function f
to both the x and y
This is used to transform a Point<T>
into a Point<R>
.
Sourcepub fn get(self, axis: AbstractAxis) -> T
pub fn get(self, axis: AbstractAxis) -> T
Gets the extent of the specified layout axis
Whether this is the width or height depends on the GridAxis
provided
Sourcepub fn set(&mut self, axis: AbstractAxis, value: T)
pub fn set(&mut self, axis: AbstractAxis, value: T)
Sets the extent of the specified layout axis
Whether this is the width or height depends on the GridAxis
provided
Source§impl<T: TaffyMinContent> Point<T>
impl<T: TaffyMinContent> Point<T>
Sourcepub const fn min_content() -> Self
pub const fn min_content() -> Self
Returns a Point where both the x and y values are the min_content value of the contained type (e.g. Dimension::Auto or LengthPercentageAuto::Auto)
Source§impl<T: TaffyMaxContent> Point<T>
impl<T: TaffyMaxContent> Point<T>
Sourcepub const fn max_content() -> Self
pub const fn max_content() -> Self
Returns a Point where both the x and y values are the max_content value of the contained type (e.g. Dimension::Auto or LengthPercentageAuto::Auto)
Source§impl<T: TaffyFitContent> Point<T>
impl<T: TaffyFitContent> Point<T>
Sourcepub fn fit_content(argument: LengthPercentage) -> Self
pub fn fit_content(argument: LengthPercentage) -> Self
Returns a Point with x and y set to the same fit-content(…)
value
with the given argument.