[−][src]Trait embedded_graphics::drawable::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) -> Coord
Get the top left corner of the bounding box for an object
fn bottom_right(&self) -> Coord
Get the bottom right corner of the bounding box for an object
fn size(&self) -> UnsignedCoord
Get the width and height for an object
Implementors
impl<'a, C, Conf> Dimensions for FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
[src]
C: PixelColor,
Conf: FontBuilderConf,
fn top_left(&self) -> Coord
[src]
fn bottom_right(&self) -> Coord
[src]
fn size(&self) -> UnsignedCoord
[src]
Get the bounding box of a piece of text
Currently does not handle newlines (but neither does the rasteriser). It will give (0, 0)
if the string to render is empty.
impl<'a, C, T> Dimensions for Image<'a, C, T> where
C: PixelColor,
T: ImageType,
[src]
C: PixelColor,
T: ImageType,
fn top_left(&self) -> Coord
[src]
fn bottom_right(&self) -> Coord
[src]
fn size(&self) -> UnsignedCoord
[src]
impl<C> Dimensions for Circle<C> where
C: PixelColor,
[src]
C: PixelColor,
fn top_left(&self) -> Coord
[src]
fn bottom_right(&self) -> Coord
[src]
fn size(&self) -> UnsignedCoord
[src]
impl<C> Dimensions for Line<C> where
C: PixelColor,
[src]
C: PixelColor,
fn top_left(&self) -> Coord
[src]
fn bottom_right(&self) -> Coord
[src]
fn size(&self) -> UnsignedCoord
[src]
impl<C> Dimensions for Rectangle<C> where
C: PixelColor,
[src]
C: PixelColor,
fn top_left(&self) -> Coord
[src]
fn bottom_right(&self) -> Coord
[src]
fn size(&self) -> UnsignedCoord
[src]
impl<C> Dimensions for Triangle<C> where
C: PixelColor,
[src]
C: PixelColor,