summaryrefslogtreecommitdiffstats
path: root/core/src/point.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/point.rs')
-rw-r--r--core/src/point.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/point.rs b/core/src/point.rs
index 47c8b142..b9a8149c 100644
--- a/core/src/point.rs
+++ b/core/src/point.rs
@@ -11,10 +11,15 @@ pub struct Point {
}
impl Point {
+ /// The origin (i.e. a [`Point`] with both X=0 and Y=0).
+ ///
+ /// [`Point`]: struct.Point.html
+ pub const ORIGIN: Point = Point::new(0.0, 0.0);
+
/// Creates a new [`Point`] with the given coordinates.
///
/// [`Point`]: struct.Point.html
- pub fn new(x: f32, y: f32) -> Self {
+ pub const fn new(x: f32, y: f32) -> Self {
Self { x, y }
}
}