Implement Overlay::translate
This commit is contained in:
parent
afd9274de2
commit
f7a370b6b9
@ -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;
|
use std::rc::Rc;
|
||||||
|
|
||||||
#[allow(missing_debug_implementations)]
|
#[allow(missing_debug_implementations)]
|
||||||
@ -18,6 +20,11 @@ where
|
|||||||
Self { position, layer }
|
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>
|
pub fn map<B>(self, f: Rc<dyn Fn(Message) -> B>) -> Overlay<'a, B, Renderer>
|
||||||
where
|
where
|
||||||
Message: 'static,
|
Message: 'static,
|
||||||
|
Loading…
Reference in New Issue
Block a user