Implement scroll_by operation for scrollable
`scroll_by` allows scrolling an absolute offset that is applied to the current scrolling position.
This commit is contained in:
parent
44235f0c0b
commit
e102e89c6a
5 changed files with 157 additions and 36 deletions
|
|
@ -20,6 +20,17 @@ impl Vector {
|
|||
pub const ZERO: Self = Self::new(0.0, 0.0);
|
||||
}
|
||||
|
||||
impl<T> std::ops::Neg for Vector<T>
|
||||
where
|
||||
T: std::ops::Neg<Output = T>,
|
||||
{
|
||||
type Output = Self;
|
||||
|
||||
fn neg(self) -> Self::Output {
|
||||
Self::new(-self.x, -self.y)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> std::ops::Add for Vector<T>
|
||||
where
|
||||
T: std::ops::Add<Output = T>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue