Don't start dragging until you move to 2px
This commit is contained in:
parent
239b0c2f71
commit
38a7b39070
2 changed files with 10 additions and 3 deletions
|
@ -7,9 +7,7 @@ use std::{
|
|||
ops::{Add, Div, Mul, MulAssign, Sub},
|
||||
};
|
||||
|
||||
#[derive(
|
||||
Refineable, Default, Add, AddAssign, Sub, SubAssign, Copy, Debug, PartialEq, Eq, Hash,
|
||||
)]
|
||||
#[derive(Refineable, Default, Add, AddAssign, Sub, SubAssign, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
#[refineable(debug)]
|
||||
#[repr(C)]
|
||||
pub struct Point<T: Default + Clone + Debug> {
|
||||
|
@ -41,6 +39,10 @@ impl Point<Pixels> {
|
|||
y: self.y.scale(factor),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn magnitude(&self) -> f64 {
|
||||
((self.x.0.powi(2) + self.y.0.powi(2)) as f64).sqrt()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, Rhs> Mul<Rhs> for Point<T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue