#[repr(transparent)]pub struct OriginZeroLine(pub i16);
Expand description
Represents a grid line position in “OriginZero” coordinates
“OriginZero” coordinates are a normalized form:
- The line at left hand (or top) edge of the explicit grid is line 0
- The next line to the right (or down) is 1, and so on
- The next line to the left (or up) is -1, and so on
Tuple Fields§
§0: i16
Implementations§
Source§impl OriginZeroLine
impl OriginZeroLine
Sourcepub(crate) fn into_track_vec_index(self, track_counts: TrackCounts) -> usize
pub(crate) fn into_track_vec_index(self, track_counts: TrackCounts) -> usize
Converts a grid line in OriginZero coordinates into the index of that same grid line in the GridTrackVec.
Sourcepub(crate) fn try_into_track_vec_index(
self,
track_counts: TrackCounts,
) -> Option<usize>
pub(crate) fn try_into_track_vec_index( self, track_counts: TrackCounts, ) -> Option<usize>
Converts a grid line in OriginZero coordinates into the index of that same grid line in the GridTrackVec.
This fallible version is used for the placement of absolutely positioned grid items:
If a grid-placement property refers to a non-existent line either by explicitly specifying such a line or by spanning outside of the existing implicit grid, it is instead treated as specifying auto (instead of creating new implicit grid lines).
The infallible version above if used when placing regular in-flow grid items.
Sourcepub(crate) fn implied_negative_implicit_tracks(self) -> u16
pub(crate) fn implied_negative_implicit_tracks(self) -> u16
The minimum number of negative implicit track there must be if a grid item starts at this line.
Sourcepub(crate) fn implied_positive_implicit_tracks(
self,
explicit_track_count: u16,
) -> u16
pub(crate) fn implied_positive_implicit_tracks( self, explicit_track_count: u16, ) -> u16
The minimum number of positive implicit track there must be if a grid item end at this line.
Trait Implementations§
Source§impl Add<u16> for OriginZeroLine
impl Add<u16> for OriginZeroLine
Source§impl Add for OriginZeroLine
impl Add for OriginZeroLine
Source§type Output = OriginZeroLine
type Output = OriginZeroLine
+
operator.Source§impl AddAssign<u16> for OriginZeroLine
impl AddAssign<u16> for OriginZeroLine
Source§fn add_assign(&mut self, rhs: u16)
fn add_assign(&mut self, rhs: u16)
+=
operation. Read moreSource§impl Clone for OriginZeroLine
impl Clone for OriginZeroLine
Source§fn clone(&self) -> OriginZeroLine
fn clone(&self) -> OriginZeroLine
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OriginZeroLine
impl Debug for OriginZeroLine
Source§impl Ord for OriginZeroLine
impl Ord for OriginZeroLine
Source§fn cmp(&self, other: &OriginZeroLine) -> Ordering
fn cmp(&self, other: &OriginZeroLine) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for OriginZeroLine
impl PartialEq for OriginZeroLine
Source§impl PartialOrd for OriginZeroLine
impl PartialOrd for OriginZeroLine
Source§impl Sub<u16> for OriginZeroLine
impl Sub<u16> for OriginZeroLine
Source§impl Sub for OriginZeroLine
impl Sub for OriginZeroLine
Source§type Output = OriginZeroLine
type Output = OriginZeroLine
-
operator.