Add an `Outline::with_capacity()` method
This commit is contained in:
parent
4dea6aa258
commit
5eb346f77d
|
@ -61,6 +61,15 @@ impl Outline {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns a new `Outline` with storage for `capacity` contours preallocated.
|
||||
#[inline]
|
||||
pub fn with_capacity(capacity: usize) -> Outline {
|
||||
Outline {
|
||||
contours: Vec::with_capacity(capacity),
|
||||
bounds: RectF::default(),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_segments<I>(segments: I) -> Outline
|
||||
where
|
||||
|
|
Loading…
Reference in New Issue