diff options
author | 2020-04-30 07:38:46 +0200 | |
---|---|---|
committer | 2020-04-30 07:38:46 +0200 | |
commit | d4c4198f7242f168de65146e0ca339e0c1cbfe9b (patch) | |
tree | 89ba3fb312c65264593720586df7e55726550e21 /wgpu/src/widget/canvas/geometry.rs | |
parent | 1501a93915b3704a1d57da4c390a8ebca4e35c8b (diff) | |
download | iced-d4c4198f7242f168de65146e0ca339e0c1cbfe9b.tar.gz iced-d4c4198f7242f168de65146e0ca339e0c1cbfe9b.tar.bz2 iced-d4c4198f7242f168de65146e0ca339e0c1cbfe9b.zip |
Write documentation for the new `canvas` API
Diffstat (limited to 'wgpu/src/widget/canvas/geometry.rs')
-rw-r--r-- | wgpu/src/widget/canvas/geometry.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/wgpu/src/widget/canvas/geometry.rs b/wgpu/src/widget/canvas/geometry.rs index 12ef828f..4cadee39 100644 --- a/wgpu/src/widget/canvas/geometry.rs +++ b/wgpu/src/widget/canvas/geometry.rs @@ -1,5 +1,13 @@ use crate::Primitive; +/// A bunch of shapes that can be drawn. +/// +/// [`Geometry`] can be easily generated with a [`Frame`] or stored in a +/// [`Cache`]. +/// +/// [`Geometry`]: struct.Geometry.html +/// [`Frame`]: struct.Frame.html +/// [`Cache`]: struct.Cache.html #[derive(Debug, Clone)] pub struct Geometry(Primitive); @@ -8,6 +16,12 @@ impl Geometry { Self(primitive) } + /// Turns the [`Geometry`] into a [`Primitive`]. + /// + /// This can be useful if you are building a custom widget. + /// + /// [`Geometry`]: struct.Geometry.html + /// [`Primitive`]: ../enum.Primitive.html pub fn into_primitive(self) -> Primitive { self.0 } |