mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add first control point if there's no subpath
This commit is contained in:
parent
08461db4da
commit
ca1e780c59
4 changed files with 5 additions and 14 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue