Implement Rectangle::position
This commit is contained in:
parent
61c707fe04
commit
afa0bca4fd
1 changed files with 7 additions and 0 deletions
|
|
@ -72,6 +72,13 @@ impl Rectangle<f32> {
|
|||
self.y + self.height / 2.0
|
||||
}
|
||||
|
||||
/// Returns the position of the top left corner of the [`Rectangle`].
|
||||
///
|
||||
/// [`Rectangle`]: struct.Rectangle.html
|
||||
pub fn position(&self) -> Point {
|
||||
Point::new(self.x, self.y)
|
||||
}
|
||||
|
||||
/// Returns the [`Size`] of the [`Rectangle`].
|
||||
///
|
||||
/// [`Size`]: struct.Size.html
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue