Trait sark_grids::point::Point2dFormatter
source · [−]pub trait Point2dFormatter {
fn point(&self, size: impl Size2d) -> IVec2;
fn pivot(self, pivot: Pivot) -> FormattedPoint;
fn relative_point(&self, xy: impl Point2d) -> IVec2;
}
Expand description
A trait for aligning a 2d point with a sized rectangle.
Required methods
fn pivot(self, pivot: Pivot) -> FormattedPoint
fn pivot(self, pivot: Pivot) -> FormattedPoint
Set the pivot for this point.
fn relative_point(&self, xy: impl Point2d) -> IVec2
fn relative_point(&self, xy: impl Point2d) -> IVec2
Retrieve a point relative to this one given the current pivot.