Use image renderer for iced text widget

This commit is contained in:
Jeremy Soller 2022-10-31 12:04:33 -06:00
parent b0ec548a5e
commit d49e8881fd
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
4 changed files with 74 additions and 58 deletions

View file

@ -148,14 +148,11 @@ impl<'a> BufferLine<'a> {
/// Layout line, will cache results
pub fn layout(&mut self, font_system: &'a FontSystem<'a>, font_size: i32, width: i32) -> &[LayoutLine] {
if self.layout_opt.is_none() {
let mut layout = Vec::new();
let wrap_simple = self.wrap_simple;
let shape = self.shape(font_system);
shape.layout(
let layout = shape.layout(
font_size,
width,
&mut layout,
0,
wrap_simple
);
self.layout_opt = Some(layout);