Skip to content

Commit

Permalink
Add first control point if there's no subpath
Browse files Browse the repository at this point in the history
  • Loading branch information
pylbrecht committed Jan 16, 2020
1 parent 08461db commit ca1e780
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
7 changes: 5 additions & 2 deletions components/canvas/canvas_data.rs
Expand Up @@ -771,8 +771,8 @@ impl<'a> CanvasData<'a> {
}

pub fn quadratic_curve_to(&mut self, cp: &Point2D<f32>, endpoint: &Point2D<f32>) {
if self.path_builder().current_point().is_none() {
self.path_builder().move_to(cp);
if self.path_state.is_none() {
self.move_to(cp);
}
self.path_builder().quadratic_curve_to(cp, endpoint);
}
Expand All @@ -783,6 +783,9 @@ impl<'a> CanvasData<'a> {
cp2: &Point2D<f32>,
endpoint: &Point2D<f32>,
) {
if self.path_state.is_none() {
self.move_to(cp1);
}
self.path_builder().bezier_curve_to(cp1, cp2, endpoint);
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit ca1e780

Please sign in to comment.