mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #25445 - pylbrecht:ensure.path.quad, r=jdm
Ensure subpath for control point of CanvasRenderingContext2D.quadraticCurveTo() <!-- Please describe your changes on the following line: --> These changes are based on #25444. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #25331 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
b876168721
4 changed files with 3 additions and 12 deletions
|
@ -771,6 +771,9 @@ 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);
|
||||
}
|
||||
self.path_builder().quadratic_curve_to(cp, endpoint);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue