Trait embedded_layout::View [−][src]
pub trait View {
fn translate_impl(&mut self, by: Point);
fn bounds(&self) -> Rectangle;
fn size(&self) -> Size { ... }
fn translate_mut(&mut self, by: Point) -> &mut Self
where
Self: Sized,
{ ... }
fn translate(self, by: Point) -> Self
where
Self: Sized,
{ ... }
}Expand description
A View is the base unit for most of the embedded-layout operations.
Views must have a size and a position.
See the custom_view example for how you can define more complex views.
Required methods
fn translate_impl(&mut self, by: Point)
fn translate_impl(&mut self, by: Point)Object-safe version of translate_mut().
The default implementations of translate and translate_mut both call this functions.
Provided methods
fn translate_mut(&mut self, by: Point) -> &mut Self where
Self: Sized,
fn translate_mut(&mut self, by: Point) -> &mut Self where
Self: Sized, Move the origin of an object by a given number of (x, y) pixels, mutating the object in place.
If you a looking for a method to implement, you might want translate_impl() instead.