[−][src]Trait embedded_graphics::geometry::Dimensions
Adds the ability to get the dimensions/position of a graphics object
This should be implemented for all builtin embedded-graphics primitives and fonts. Third party implementations do not have to implement this trait as an object may not have a known size. If the object does have a known size, this trait should be implemented.
Required methods
fn top_left(&self) -> Point
Get the top left corner of the bounding box for an object
fn bottom_right(&self) -> Point
Get the bottom right corner of the bounding box for an object
fn size(&self) -> Size
Get the width and height for an object
Implementors
impl Dimensions for Circle
[src]
impl Dimensions for Line
[src]
impl Dimensions for Rectangle
[src]
impl Dimensions for Triangle
[src]
impl<'_, C, F> Dimensions for Styled<Text<'_>, TextStyle<C, F>> where
C: PixelColor,
F: Font,
[src]
C: PixelColor,
F: Font,
fn top_left(&self) -> Point
[src]
fn bottom_right(&self) -> Point
[src]
fn size(&self) -> Size
[src]
Returns the size of the bounding box of a styled text.
Currently does not handle newlines (but neither does the rasteriser).
It will return Size::zero()
if the string to render is empty.
impl<'a, I, C> Dimensions for Image<'a, I, C> where
I: ImageDimensions,
C: PixelColor + From<<C as PixelColor>::Raw>,
[src]
I: ImageDimensions,
C: PixelColor + From<<C as PixelColor>::Raw>,
impl<T, S> Dimensions for Styled<T, S> where
T: Dimensions,
[src]
T: Dimensions,