Add a `clear` method to `Outline` as suggested in #289

This commit is contained in:
Patrick Walton 2020-03-26 08:34:47 -07:00
parent 0c93045f50
commit 0c24619dd0
1 changed files with 7 additions and 0 deletions

View File

@ -120,6 +120,13 @@ impl Outline {
&self.contours &self.contours
} }
/// Removes all contours from this outline.
#[inline]
pub fn clear(&mut self) {
self.contours.clear();
self.bounds = RectF::default();
}
pub fn push_contour(&mut self, contour: Contour) { pub fn push_contour(&mut self, contour: Contour) {
if contour.is_empty() { if contour.is_empty() {
return; return;