Implement Overlay::translate
This commit is contained in:
parent
afd9274de2
commit
f7a370b6b9
1 changed files with 8 additions and 1 deletions
|
|
@ -1,4 +1,6 @@
|
|||
use crate::{layout, Clipboard, Event, Hasher, Layer, Layout, Point, Size};
|
||||
use crate::{
|
||||
layout, Clipboard, Event, Hasher, Layer, Layout, Point, Size, Vector,
|
||||
};
|
||||
use std::rc::Rc;
|
||||
|
||||
#[allow(missing_debug_implementations)]
|
||||
|
|
@ -18,6 +20,11 @@ where
|
|||
Self { position, layer }
|
||||
}
|
||||
|
||||
pub fn translate(mut self, translation: Vector) -> Self {
|
||||
self.position = self.position + translation;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn map<B>(self, f: Rc<dyn Fn(Message) -> B>) -> Overlay<'a, B, Renderer>
|
||||
where
|
||||
Message: 'static,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue