Add first control point if there's no subpath

This commit is contained in:
pylbrecht 2020-01-16 21:22:22 +01:00
parent 08461db4da
commit ca1e780c59
4 changed files with 5 additions and 14 deletions

View file

@ -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);
}
@ -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);
}