Implement canvas::Path::circle helper method

This commit is contained in:
Héctor Ramón Jiménez 2020-04-14 06:54:12 +02:00
parent c545af3577
commit 46cd0891d2
3 changed files with 15 additions and 11 deletions

View file

@ -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