Implement Overlay::translate

This commit is contained in:
Héctor Ramón Jiménez 2020-04-18 19:27:54 +02:00
parent afd9274de2
commit f7a370b6b9

View File

@ -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,