From ecc5714da59b876b7775a04caba2dab2c9653f15 Mon Sep 17 00:00:00 2001 From: matt rice Date: Mon, 13 Nov 2023 00:50:52 -0800 Subject: [PATCH] Make TranslateScale::from_scale_about to take `Into`. bring it into alignment with `Rect` methods that take `Into`. --- src/translate_scale.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/translate_scale.rs b/src/translate_scale.rs index 1801f3de..ba47de0a 100644 --- a/src/translate_scale.rs +++ b/src/translate_scale.rs @@ -91,11 +91,11 @@ impl TranslateScale { /// assert_near(ts * Point::new(2., 2.), Point::new(3., 3.)); /// ``` #[inline] - pub fn from_scale_about(scale: f64, focus: Point) -> Self { + pub fn from_scale_about(scale: f64, focus: impl Into) -> Self { // We need to create a transform that is equivalent to translating `focus` // to the origin, followed by a normal scale, followed by reversing the translation. // We need to find the (translation ∘ scale) that matches this. - let focus = focus.to_vec2(); + let focus = focus.into().to_vec2(); let translation = focus - focus * scale; Self::new(translation, scale) }