Expand description
The dimension of a rectangular grid as the integer number of columns and rows.
Fields
x: i32
y: i32
Implementations
Constructs new dimension where the overall rectangle is composed by the
lowest number of rectangles of equal size lower than the given count
,
so that they should be aligned in such a manner that the number of rows
and number of columns are equal (with the last row possibly not being
completely filled).
Gets the number of tiles in a grid of given Dimension, equal to the number of row by the number of columns.
Returns true only if the components of this Dimension are equal in magnitude,
that is, self.x == self.y
, and therefore this Dimension represents a square.
Returns true only if the given Location is within this Dimension.
Gets the aspect ratio of this Dimension.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Dimension
impl UnwindSafe for Dimension
Blanket Implementations
Mutably borrows from an owned value. Read more