Added an enum with the option for "No Wraping"

This commit is contained in:
Hojjat 2022-12-20 12:48:37 -07:00 committed by Jeremy Soller
parent 48087b592b
commit b9fef72f76
7 changed files with 169 additions and 96 deletions

View file

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
use core::fmt::Display;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
@ -57,3 +59,24 @@ pub struct LayoutLine {
/// Glyphs in line
pub glyphs: Vec<LayoutGlyph>,
}
/// Wrapping mode
#[derive(Debug, Eq, PartialEq, Clone, Copy)]
pub enum Wrap {
/// No wrapping
None,
/// Wraps at a glyph level
Glyph,
/// Word Wrapping
Word,
}
impl Display for Wrap {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Self::None => write!(f, "No Wrap"),
Self::Word => write!(f, "Word Wrap"),
Self::Glyph => write!(f, "Character"),
}
}
}