add Contour::clear

This commit is contained in:
Sebastian 2020-03-28 19:22:39 +03:00 committed by GitHub
parent ed2807eb84
commit cb91f40d7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -281,6 +281,15 @@ impl Contour {
)
}
/// restore self to the state of Contour::new(), but keep the points buffer allocated
#[inline]
pub fn clear(&mut self) {
self.points.clear();
self.flags.clear();
self.bounds = RectF::default();
self.closed = false;
}
#[inline]
pub fn iter(&self, flags: ContourIterFlags) -> ContourIter {
ContourIter {