pub fn padding<C: PixelColor, L: Layoutable<C>>(
layoutable: L,
top: i32,
right: i32,
bottom: i32,
left: i32,
) -> impl Layoutable<C>Expand description
Adjust placement of a component by adding/removing additional offsets
§Arguments
layoutable: element to placetop: adjustment to the topright: adjustment on the rightbottom: adjustment to the bottomleft: adjustment on the left
returns: impl Layoutable
§Examples
use embedded_graphics::geometry::Point;
use embedded_graphics::mono_font::iso_8859_1::FONT_6X12;
use embedded_graphics::mono_font::MonoTextStyle;
use embedded_graphics::pixelcolor::BinaryColor;
use embedded_graphics::text::Text;
use simple_layout::prelude::padding;
let adjusted_text = padding(Text::new("-", Point::zero(), MonoTextStyle::new(&FONT_6X12, BinaryColor::On)), -2, 1, -1, 1);