diff options
Diffstat (limited to 'components/canvas/canvas_data.rs')
-rw-r--r-- | components/canvas/canvas_data.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/components/canvas/canvas_data.rs b/components/canvas/canvas_data.rs index 29dd1743b46..ab30dbe9741 100644 --- a/components/canvas/canvas_data.rs +++ b/components/canvas/canvas_data.rs @@ -108,7 +108,7 @@ pub trait GenericPathBuilder { end_angle: f32, anticlockwise: bool, ); - fn get_current_point(&mut self) -> Point2D<f32>; + fn get_current_point(&mut self) -> Option<Point2D<f32>>; fn line_to(&mut self, point: Point2D<f32>); fn move_to(&mut self, point: Point2D<f32>); fn quadratic_curve_to(&mut self, control_point: &Point2D<f32>, end_point: &Point2D<f32>); @@ -205,8 +205,10 @@ impl<'a> PathBuilderRef<'a> { Some(i) => i, None => return None, }; - let current_point = self.builder.get_current_point(); - Some(inverse.transform_point(Point2D::new(current_point.x, current_point.y))) + match self.builder.get_current_point() { + Some(point) => Some(inverse.transform_point(Point2D::new(point.x, point.y))), + None => None, + } } } @@ -356,7 +358,7 @@ pub enum Pattern<'a> { #[cfg(feature = "canvas2d-azure")] Azure(azure::azure_hl::Pattern, PhantomData<&'a ()>), #[cfg(feature = "canvas2d-raqote")] - Raqote(raqote::Source<'a>), + Raqote(crate::raqote_backend::Pattern<'a>), } pub enum DrawSurfaceOptions { |