diff --git a/src/geometry/scale_ops.rs b/src/geometry/scale_ops.rs index 4d8b5f41..6a55cf40 100644 --- a/src/geometry/scale_ops.rs +++ b/src/geometry/scale_ops.rs @@ -36,34 +36,19 @@ add_sub_impl!(Mul, mul, ClosedMul; self: Scale, right: Scale, Output = Scale; #[allow(clippy::suspicious_arithmetic_impl)] { Scale::from(self.vector.component_mul(&right.vector)) }; ); -// Scale ÷ Scale -// TODO: instead of calling inverse explicitly, could we just add a `mul_tr` or `mul_inv` method? -/*add_sub_impl!(Div, div, ClosedSub; +// Scale × scalar +add_sub_impl!(Mul, mul, ClosedMul; (Const, U1), (Const, U1) -> (Const, U1) const D; for; where; - self: &'a Scale, right: &'b Scale, Output = Scale; - #[allow(clippy::suspicious_arithmetic_impl)] { todo!(); }; - 'a, 'b); - -add_sub_impl!(Div, div, ClosedSub; - (Const, U1), (Const, U1) -> (Const, U1) - const D; for; where; - self: &'a Scale, right: Scale, Output = Scale; - #[allow(clippy::suspicious_arithmetic_impl)] { todo!(); }; + self: &'a Scale, right: T, Output = Scale; + #[allow(clippy::suspicious_arithmetic_impl)] { Scale::from(&self.vector * right) }; 'a); -add_sub_impl!(Div, div, ClosedSub; +add_sub_impl!(Mul, mul, ClosedMul; (Const, U1), (Const, U1) -> (Const, U1) const D; for; where; - self: Scale, right: &'b Scale, Output = Scale; - #[allow(clippy::suspicious_arithmetic_impl)] { todo!(); }; - 'b); - -add_sub_impl!(Div, div, ClosedSub; - (Const, U1), (Const, U1) -> (Const, U1) - const D; for; where; - self: Scale, right: Scale, Output = Scale; - #[allow(clippy::suspicious_arithmetic_impl)] { todo!(); }; );*/ + self: Scale, right: T, Output = Scale; + #[allow(clippy::suspicious_arithmetic_impl)] { Scale::from(self.vector * right) }; ); // Scale × Point // TODO: we don't handle properly non-zero origins here. Do we want this to be the intended @@ -106,14 +91,3 @@ add_sub_assign_impl!(MulAssign, mul_assign, ClosedMul; const D; self: Scale, right: Scale; #[allow(clippy::suspicious_op_assign_impl)] { self.vector.component_mul_assign(&right.vector); }; ); - -/*add_sub_assign_impl!(DivAssign, div_assign, ClosedSub; - const D; - self: Scale, right: &'b Scale; - #[allow(clippy::suspicious_op_assign_impl)] { todo!(); }; - 'b); - -add_sub_assign_impl!(DivAssign, div_assign, ClosedSub; - const D; - self: Scale, right: Scale; - #[allow(clippy::suspicious_op_assign_impl)] { todo!(); }; );*/