diff --git a/examples/text_wrapping.rs b/examples/text_wrapping.rs index bc5d569..1f711fa 100644 --- a/examples/text_wrapping.rs +++ b/examples/text_wrapping.rs @@ -30,7 +30,8 @@ fn draw(f: &mut Frame) { "123456789\tx\n", ); - let breaks = f.wrap(text, f.size().width.into()); + let width = f.size().width.into(); + let breaks = f.widthdb().wrap(text, width); let lines = Styled::new_plain(text).split_at_indices(&breaks); for (i, mut line) in lines.into_iter().enumerate() { line.trim_end(); diff --git a/src/frame.rs b/src/frame.rs index 5bb4436..3eef23b 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -4,7 +4,6 @@ use crate::buffer::Buffer; pub use crate::buffer::{Pos, Size}; use crate::styled::Styled; use crate::widthdb::WidthDb; -use crate::wrap; #[derive(Debug, Default)] pub struct Frame { @@ -49,10 +48,6 @@ impl Frame { &mut self.widthdb } - pub fn wrap(&mut self, text: &str, width: usize) -> Vec { - wrap::wrap(&mut self.widthdb, text, width) - } - pub fn write>(&mut self, pos: Pos, styled: S) { self.buffer.write(&mut self.widthdb, pos, &styled.into()); }