mirror of
https://github.com/servo/servo.git
synced 2025-08-01 03:30:33 +01:00
Handle empty paths in PathBuilder::get_current_point()
The case of calling get_current_point() on empty paths has not been handled and caused panics.
This commit is contained in:
parent
606ad20544
commit
b8b33788b6
3 changed files with 15 additions and 17 deletions
|
@ -189,9 +189,9 @@ impl GenericPathBuilder for azure_hl::PathBuilder {
|
|||
anticlockwise,
|
||||
);
|
||||
}
|
||||
fn get_current_point(&mut self) -> Point2D<f32> {
|
||||
fn get_current_point(&mut self) -> Option<Point2D<f32>> {
|
||||
let AzPoint { x, y } = azure_hl::PathBuilder::get_current_point(self);
|
||||
Point2D::new(x as f32, y as f32)
|
||||
Some(Point2D::new(x as f32, y as f32))
|
||||
}
|
||||
fn line_to(&mut self, point: Point2D<f32>) {
|
||||
azure_hl::PathBuilder::line_to(self, point as Point2D<AzFloat>);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue