Merge pull request #290 from s3bk/patch-1

add Contour::clear
This commit is contained in:
Patrick Walton 2020-03-30 22:01:04 -07:00 committed by GitHub
commit d83f54457c
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 {