Replace generic into call with Vector::from

This commit is contained in:
Héctor Ramón Jiménez 2025-06-04 12:14:31 +02:00
parent 6f935f3449
commit 08a37406f2
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -244,7 +244,7 @@ impl Rectangle<f32> {
/// Snaps the [`Rectangle`] to __unsigned__ integer coordinates.
pub fn snap(self) -> Option<Rectangle<u32>> {
let top_left = self.position().snap();
let bottom_right = (self.position() + self.size().into()).snap();
let bottom_right = (self.position() + Vector::from(self.size())).snap();
let width = bottom_right.x.checked_sub(top_left.x)?;
let height = bottom_right.y.checked_sub(top_left.y)?;