From c09ef3ae7cabbe4816f2074df3f8b9c3a03c0351 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 13 May 2019 18:19:10 -0700 Subject: [PATCH] Fix SVG and demo compilation errors --- demo/common/src/camera.rs | 2 +- svg/src/lib.rs | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/demo/common/src/camera.rs b/demo/common/src/camera.rs index cbd6559e..2121d8bd 100644 --- a/demo/common/src/camera.rs +++ b/demo/common/src/camera.rs @@ -56,7 +56,7 @@ impl Camera { let scale = i32::min(viewport_size.x(), viewport_size.y()) as f32 * scale_factor_for_view_box(view_box); let origin = viewport_size.to_f32().scale(0.5) - view_box.size().scale(scale * 0.5); - Camera::TwoD(Transform2DF32::from_scale(&Point2DF32::splat(scale)).post_translate(origin)) + Camera::TwoD(Transform2DF32::from_scale(Point2DF32::splat(scale)).post_translate(origin)) } fn new_3d(mode: Mode, view_box: RectF32, viewport_size: Point2DI32) -> Camera { diff --git a/svg/src/lib.rs b/svg/src/lib.rs index 90f5a172..249bb8fe 100644 --- a/svg/src/lib.rs +++ b/svg/src/lib.rs @@ -313,8 +313,7 @@ where } UsvgPathSegment::LineTo { x, y } => { let to = Point2DF32::new(x as f32, y as f32); - let mut segment = - Segment::line(&LineSegmentF32::new(&self.last_subpath_point, &to)); + let mut segment = Segment::line(&LineSegmentF32::new(self.last_subpath_point, to)); if self.just_moved { segment.flags.insert(SegmentFlags::FIRST_IN_SUBPATH); } @@ -334,8 +333,8 @@ where let ctrl1 = Point2DF32::new(x2 as f32, y2 as f32); let to = Point2DF32::new(x as f32, y as f32); let mut segment = Segment::cubic( - &LineSegmentF32::new(&self.last_subpath_point, &to), - &LineSegmentF32::new(&ctrl0, &ctrl1), + &LineSegmentF32::new(self.last_subpath_point, to), + &LineSegmentF32::new(ctrl0, ctrl1), ); if self.just_moved { segment.flags.insert(SegmentFlags::FIRST_IN_SUBPATH); @@ -346,8 +345,8 @@ where } UsvgPathSegment::ClosePath => { let mut segment = Segment::line(&LineSegmentF32::new( - &self.last_subpath_point, - &self.first_subpath_point, + self.last_subpath_point, + self.first_subpath_point, )); segment.flags.insert(SegmentFlags::CLOSES_SUBPATH); self.just_moved = false;