Create iced_lazy and draft Component trait

This commit is contained in:
Héctor Ramón Jiménez 2021-11-07 18:15:01 +07:00
parent d9f970ffd5
commit bffa7203df
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
5 changed files with 201 additions and 0 deletions

View file

@ -25,6 +25,11 @@ where
Self { position, overlay }
}
/// Returns the position of the [`Element`].
pub fn position(&self) -> Point {
self.position
}
/// Translates the [`Element`].
pub fn translate(mut self, translation: Vector) -> Self {
self.position = self.position + translation;