summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-14 06:54:12 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-04-14 06:54:12 +0200
commit46cd0891d25c2dd48e182747d8c1f9579b066490 (patch)
tree0ab07cb96727530b4ea5298d5a22a6a883c25568 /wgpu
parentc545af35773307d16eca7ec03ed4794f26491da2 (diff)
downloadiced-46cd0891d25c2dd48e182747d8c1f9579b066490.tar.gz
iced-46cd0891d25c2dd48e182747d8c1f9579b066490.tar.bz2
iced-46cd0891d25c2dd48e182747d8c1f9579b066490.zip
Implement `canvas::Path::circle` helper method
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/widget/canvas/path.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/wgpu/src/widget/canvas/path.rs b/wgpu/src/widget/canvas/path.rs
index d714ad05..19d8879a 100644
--- a/wgpu/src/widget/canvas/path.rs
+++ b/wgpu/src/widget/canvas/path.rs
@@ -43,6 +43,14 @@ impl Path {
Self::new(|p| p.rectangle(top_left, size))
}
+ /// Creates a new [`Path`] representing a circle given its center
+ /// coordinate and its radius.
+ ///
+ /// [`Path`]: struct.Path.html
+ pub fn circle(center: Point, radius: f32) -> Self {
+ Self::new(|p| p.circle(center, radius))
+ }
+
#[inline]
pub(crate) fn raw(&self) -> &lyon::path::Path {
&self.raw