add Outline::{len, from_rect_rounded}

This commit is contained in:
Sebastian K 2020-06-17 09:04:27 +03:00
parent 29ef4229a9
commit 6b6a3b324d
1 changed files with 12 additions and 0 deletions

View File

@ -127,6 +127,18 @@ impl Outline {
outline
}
#[inline]
pub fn from_rect_rounded(rect: RectF, radius: Vector2F) -> Outline {
let mut outline = Outline::new();
outline.push_contour(Contour::from_rect_rounded(rect, radius));
outline
}
#[inline]
pub fn len(&self) -> usize {
self.contours.len()
}
#[inline]
pub fn bounds(&self) -> RectF {
self.bounds