Skip to content

Commit

Permalink
Close all subpaths right before filling them.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton committed Mar 27, 2020
1 parent c258616 commit 7b53cc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions content/src/outline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ impl Outline {
self.push_contour(ContourRectClipper::new(clip_rect, contour).clip());
}
}

#[inline]
pub fn close_all_contours(&mut self) {
self.contours.iter_mut().for_each(|contour| contour.close());
}
}

impl Debug for Outline {
Expand Down
2 changes: 2 additions & 0 deletions renderer/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ impl Scene {
outline = Outline::new();
} else {
outline = (*original_outline).clone();
outline.close_all_contours();
outline.clip_against_polygon(clip_polygon);
outline.apply_perspective(perspective);

Expand All @@ -147,6 +148,7 @@ impl Scene {
_ => {
// TODO(pcwalton): Short circuit.
outline = (*original_outline).clone();
outline.close_all_contours();
if options.transform.is_2d() || options.subpixel_aa_enabled {
let mut transform = match options.transform {
PreparedRenderTransform::Transform2D(transform) => transform,
Expand Down

0 comments on commit 7b53cc6

Please sign in to comment.