Skip to content

Commit

Permalink
Create new subpath with origin after drawing rect
Browse files Browse the repository at this point in the history
  • Loading branch information
pylbrecht committed Jan 19, 2020
1 parent 77c07a2 commit 3c7205c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
17 changes: 11 additions & 6 deletions components/canvas/canvas_data.rs
Expand Up @@ -143,11 +143,12 @@ impl<'a> PathBuilderRef<'a> {
),
Point2D::new(rect.origin.x, rect.origin.y + rect.size.height),
);
self.builder.move_to(self.transform.transform_point(first));
self.builder.line_to(self.transform.transform_point(second));
self.builder.line_to(self.transform.transform_point(third));
self.builder.line_to(self.transform.transform_point(fourth));
self.builder.close();
self.move_to(&first);
self.line_to(&second);
self.line_to(&third);
self.line_to(&fourth);
self.close();
self.move_to(&first);
}

fn quadratic_curve_to(&mut self, cp: &Point2D<f32>, endpoint: &Point2D<f32>) {
Expand Down Expand Up @@ -210,6 +211,10 @@ impl<'a> PathBuilderRef<'a> {
None => None,
}
}

fn close(&mut self) {
self.builder.close();
}
}

// TODO(pylbrecht)
Expand Down Expand Up @@ -573,7 +578,7 @@ impl<'a> CanvasData<'a> {
}

pub fn close_path(&mut self) {
self.path_builder().builder.close();
self.path_builder().close();
}

fn ensure_path(&mut self) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 3c7205c

Please sign in to comment.