diff --git a/content/src/outline.rs b/content/src/outline.rs index e2b26d22..e91a0af5 100644 --- a/content/src/outline.rs +++ b/content/src/outline.rs @@ -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(segments: I) -> Outline where