Struct embedded_text::style::height_mode::Exact [−][src]
pub struct Exact<OV: VerticalOverdraw>(pub OV);
Keep the original TextBox height.
Example:
use embedded_text::prelude::*; use embedded_graphics::{fonts::Font6x8, pixelcolor::BinaryColor, prelude::*}; // This TextBox contains two lines of text, but is 60px high let text_box = TextBox::new( "Two lines\nof text", Rectangle::new(Point::zero(), Point::new(59, 59)), ); // Set style, use 6x8 font so the 2 lines are 16px high. let style = TextBoxStyleBuilder::new(Font6x8) .text_color(BinaryColor::On) .build(); // Exact does not change the size of the TextBox let orig_size = text_box.size(); let size = text_box.into_styled(style).size(); assert_eq!(size, orig_size);
Trait Implementations
impl<OV: Clone + VerticalOverdraw> Clone for Exact<OV>[src]
impl<OV: Clone + VerticalOverdraw> Clone for Exact<OV>[src]impl<OV: Copy + VerticalOverdraw> Copy for Exact<OV>[src]
impl<OV: Copy + VerticalOverdraw> Copy for Exact<OV>[src]impl<OV: Debug + VerticalOverdraw> Debug for Exact<OV>[src]
impl<OV: Debug + VerticalOverdraw> Debug for Exact<OV>[src]impl<OV> HeightMode for Exact<OV> where
OV: VerticalOverdraw, [src]
impl<OV> HeightMode for Exact<OV> where
OV: VerticalOverdraw, [src]fn apply<C, F, A, V, H>(_text_box: &mut StyledTextBox<'_, C, F, A, V, H>) where
C: PixelColor,
F: Font + Copy,
A: HorizontalTextAlignment,
V: VerticalTextAlignment,
H: HeightMode, [src]
C: PixelColor,
F: Font + Copy,
A: HorizontalTextAlignment,
V: VerticalTextAlignment,
H: HeightMode,
fn calculate_displayed_row_range<F: Font>(cursor: &Cursor<F>) -> Range<i32>[src]
Auto Trait Implementations
impl<OV> RefUnwindSafe for Exact<OV> where
OV: RefUnwindSafe,
impl<OV> RefUnwindSafe for Exact<OV> where
OV: RefUnwindSafe, impl<OV> UnwindSafe for Exact<OV> where
OV: UnwindSafe,
impl<OV> UnwindSafe for Exact<OV> where
OV: UnwindSafe,