From bff711131069e8908a3e1d63162203df4c2da864 Mon Sep 17 00:00:00 2001 From: Sebastian K Date: Tue, 7 Jul 2020 21:23:11 +0300 Subject: [PATCH] remove remainds --- canvas/src/lib.rs | 5 ----- content/src/outline.rs | 3 +-- geometry/src/util.rs | 16 ---------------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/canvas/src/lib.rs b/canvas/src/lib.rs index f4070c85..897b96f1 100644 --- a/canvas/src/lib.rs +++ b/canvas/src/lib.rs @@ -806,11 +806,6 @@ impl Path2D { self.current_contour = last_contour.unwrap_or_else(Contour::new); } - #[inline] - pub fn mirror_and_close_last(&mut self) { - self.current_contour.mirror_and_close(); - } - pub fn into_outline(mut self) -> Outline { self.flush_current_contour(); self.outline diff --git a/content/src/outline.rs b/content/src/outline.rs index 9be1ca74..798e786b 100644 --- a/content/src/outline.rs +++ b/content/src/outline.rs @@ -21,7 +21,6 @@ use pathfinder_geometry::transform2d::{Transform2F, Matrix2x2F}; use pathfinder_geometry::transform3d::Perspective; use pathfinder_geometry::unit_vector::UnitVector; use pathfinder_geometry::vector::{Vector2F, vec2f}; -use pathfinder_geometry::util::{reflection}; use std::f32::consts::PI; use std::fmt::{self, Debug, Formatter}; use std::mem; @@ -603,7 +602,7 @@ impl Contour { if r.x().is_finite() & r.y().is_finite() { let r = r.abs(); - let r_inv = r.inv(); + let r_inv = r.recip(); let sign = match (large_arc, direction) { (false, ArcDirection::CW) | (true, ArcDirection::CCW) => 1.0, (false, ArcDirection::CCW) | (true, ArcDirection::CW) => -1.0 diff --git a/geometry/src/util.rs b/geometry/src/util.rs index ef5e43d8..1add973b 100644 --- a/geometry/src/util.rs +++ b/geometry/src/util.rs @@ -11,8 +11,6 @@ //! Various utilities. use std::f32; -use crate::transform2d::{Transform2F, Matrix2x2F}; -use crate::vector::Vector2F; pub const EPSILON: f32 = 0.001; @@ -39,17 +37,3 @@ pub fn clamp(x: f32, min_val: f32, max_val: f32) -> f32 { pub fn alignup_i32(a: i32, b: i32) -> i32 { (a + b - 1) / b } - -pub fn reflection(a: Vector2F, b: Vector2F) -> Transform2F { - let l = b - a; - let l2 = l * l; - let l2_yx = l2.yx(); - let d = l2 - l2_yx; - let lxy2 = 2.0 * l.x() * l.y(); - let s = 1.0 / (l2.x() + l2.y()); - - Transform2F::from_translation(-a) * Transform2F { - matrix: Matrix2x2F::row_major(d.x(), lxy2, lxy2, d.y()).scale(s), - vector: a - } -}