diff options
author | 2020-02-20 05:51:18 +0100 | |
---|---|---|
committer | 2020-02-20 05:51:18 +0100 | |
commit | 17271eae671a933a862dc85aa5b9956a7da70b28 (patch) | |
tree | 1a24e3eebb544b0bc8b0ebf2d92f330141f699bf /core/src/point.rs | |
parent | 8d63c49ba1aa43407e0dab0a8e69d3f316a79279 (diff) | |
parent | 6f7247ca13181bcdfe1a3065215c1b3204723b84 (diff) | |
download | iced-17271eae671a933a862dc85aa5b9956a7da70b28.tar.gz iced-17271eae671a933a862dc85aa5b9956a7da70b28.tar.bz2 iced-17271eae671a933a862dc85aa5b9956a7da70b28.zip |
Merge pull request #193 from hecrj/feature/canvas
Canvas widget for 2D graphics
Diffstat (limited to 'core/src/point.rs')
-rw-r--r-- | core/src/point.rs | 7 |
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 } } } |